Example #1
0
 public void IconChosen(Icon choice, Image choiceImg)
 {
     if (!firstChoice)
     {
         FirstChoice(choice);
         firstChoice = true;
         DisplayCurrentStory(choiceImg);
         return;
     }
     foreach (var item in storyNode.choices)
     {
         if (item.iconRef == choice)
         {
             storyNode = item.nextNode;
             DisplayCurrentStory(choiceImg);
             //DisplayHistory(choiceColor);
             if (storyNode.choices.Count == 0)
             {
                 SendChoice.IconSelectable = false;
                 musicEndings.CheckForEnding(item.nextNode);
                 doneEvent.Invoke();
                 restartButton.SetActive(true);
                 tuneObj.SetActive(false);
             }
             break;
         }
     }
 }
Example #2
0
    public void CheckForEnding(NodeScriptable node)
    {
        Ending foundNode = endings.Find(x => x.node == node);

        if (foundNode != null)
        {
            musicSource.clip = foundNode.clip;
            musicSource.Play();
        }
    }
Example #3
0
 void FirstChoice(Icon choice)
 {
     foreach (var item in firstChoices)
     {
         if (item.iconRef == choice)
         {
             storyNode = item.nextNode;
             break;
         }
     }
 }