void CreateButtons()
 {
     for (int i = 0; i < choices.Length - 1; i++)
     {
         GameObject   buttonObj     = (GameObject)Instantiate(choiceButton);
         Button       button        = buttonObj.GetComponent <Button>();
         ChoiceButton choiceBtn     = buttonObj.GetComponent <ChoiceButton>();
         string[]     choiceOptions = choices[i].Split(':');
         choiceBtn.SetText(choiceOptions[0]);
         choiceBtn.SetNextLine(choiceOptions[1]);
         string choiceText = "";
         for (int j = 2; j < choiceOptions.Length; j++)
         {
             choiceText += choiceOptions[j];
             if (j != choiceOptions.Length - 1)
             {
                 choiceText += ":";
             }
         }
         choiceBtn.SetChoice(choiceText);
         choiceBtn.manager = this;
         button.transform.SetParent(canvas.transform, true);
         button.transform.localPosition = new Vector3(0, -25 + (i * 50));
         button.transform.localScale    = new Vector3(1, 1, 1);
         buttons.Add(button);
         if (choices[choices.Length - 1] == "false")
         {
             choiceBtn.ParseChoice();
             break;
         }
     }
 }
Beispiel #2
0
    protected override void Awake()
    {
        langChoice.ChoiceChanged += OnChoiceChanged;

        var lang = PlayerPrefs.GetInt("lang");

        langChoice.SetChoice(lang);
    }
Beispiel #3
0
 public void Begin(StoryChoice storyDecision)
 {
     // progression state
     _isRevealingText = false;
     // set up choice buttons
     _calmChoice.SetChoice(storyDecision.CalmChoice);
     _survivalChoice.SetChoice(storyDecision.SurvivalChoice);
     _tenacityChoice.SetChoice(storyDecision.TenacityChoice);
     // display it
     _decisionView.Display(storyDecision);
     _decisionView.Reveal();
 }