示例#1
0
 public void Initialize(List <Actor> actors)
 {
     choice = new MultipleChoiceEvent(new List <string> {
         "Rest", "Explore area"
     });
     this.actors = actors;
 }
示例#2
0
    public void ProcessEvent(MultipleChoiceEvent e, MultipleChoiceEventProcessor eventManager)
    {
        var choices = e.GetClosestOptions(Constants.DefaultChoicesCount);

        for (int i = 0; i < choices.Count; ++i)
        {
            GameObject choiceGameObject = Instantiate(MultipleChoiceButtonPrefab);
            choiceGameObject.SetActive(true);
            choiceGameObject.transform.SetParent(transform, true);

            MultipleChoiceData multipleChoiceData = choiceGameObject.GetComponent <MultipleChoiceData>();
            multipleChoiceData.SetEvent(choices[i], eventManager);

            if (choiceGameObject.GetComponentsInChildren <Text>().Length > 0)
            {
                choiceGameObject.GetComponentsInChildren <Text>()[0].text = e.Choices[i].ChoiceText;
            }

            _choiceGameObjects.Add(choiceGameObject);
        }
    }
 public void ProcessEvent(MultipleChoiceEvent e)
 {
     MultipleChoiceEvent.GetComponent <MultipleChoiceEventProcessor>().ProcessEvent(e);
 }