Ejemplo n.º 1
0
 void CreateChoices(StoryPrompt prompt)
 {
     prompterChoices = new List <PrompterChoice>();
     foreach (Transform choice in choiceRoot)
     {
         Destroy(choice.gameObject);
     }
     foreach (StoryChoice choice in prompt.Choices)
     {
         GameObject prompterPrefabInstance = Instantiate(PrompterChoicePrefab);
         prompterPrefabInstance.transform.SetParent(choiceRoot, false);
         PrompterChoice pc = prompterPrefabInstance.GetComponent <PrompterChoice>();
         pc.AssignStoryChoice(choice);
         prompterChoices.Add(pc);
     }
 }
Ejemplo n.º 2
0
    public void SelectChoiceByIndex(int index)
    {
        PrompterChoice choiceFab = prompterChoices[index];

        choiceFab.OnPress();
    }