private void FinalizeChoiceActions()
    {
        ChoicesText.text = "";
        element          = null;
        // turn the controller back on:
        var controller = FindObjectOfType <SimpleController>();

        if (controller != null)
        {
            controller.enabled = true;
        }
    }
    private void DisplayInteractions(InteractiveElementAsset elementAsset)
    {
        element = elementAsset;
        var text = "";

        for (var i = 0; i < elementAsset.CurrentInteraction.Consequences.Count; i++)
        {
            text += (i + 1) + ". " + elementAsset.CurrentInteraction.Consequences[i].Response + System.Environment.NewLine;
        }

        ChoicesText.text = text;
    }
    public void HandleEndOfInteraction(InteractiveElementAsset elementAsset)
    {
        element = elementAsset;

        if (elementAsset.CurrentInteraction.Consequences.Count == 0)
        {
            FinalizeChoiceActions();
            return;
        }

        if (elementAsset.CurrentInteraction.Consequences.Count == 1)
        {
            FinalizeChoiceActions();
            ChapterManager.InteractWith(elementAsset.name, elementAsset.CurrentInteraction.Consequences[0].Choice.name);
            return;
        }

        DisplayInteractions(elementAsset);
    }
Exemplo n.º 4
0
 private static void InteractWith(InteractiveElementAsset asset, ChoiceAsset choice)
 {
     asset.Interact(choice);
 }