rznn7 / pixel-game-jam-2024-rvg

1 stars 0 forks source link

Text interaction system #26

Closed rznn7 closed 1 month ago

rznn7 commented 1 month ago

using System; using UnityEngine;

How to use

Example

public class TextualInteractionExampleUsage : MonoBehaviour
{
    public TextualInteractionManager textualInteractionManager;

    void Start()
    {
        var interaction = new TextualInteraction(
            "Do you want to start the quest?",
            "Thank you for accepting the quest!",
            "Accept",
            "Deny",
            "Close"
        );

        textualInteractionManager.StartInteraction(interaction).Subscribe((interactionAnswer) =>
        {
            if (interactionAnswer)
            {
                Debug.Log("Player accepted the interaction.");
            }
            else
            {
                Debug.Log("Player denied the interaction.");
            }
        });
    }
}