示例#1
0
 /// <summary>
 /// Adds the scene to the novel
 /// </summary>
 /// <param name="novel"></param>
 /// <param name="scene"></param>
 public static void AddScene(this LitNovel novel, LitElm scene)
 {
     foreach (var NovelScene in novel.Scenes)
     {
         if (NovelScene.IsElmMergeable(scene))
         {
             NovelScene.MergeElm(scene);
             return;
         }
     }
     novel.Scenes.Add(scene);
 }
示例#2
0
 private void HandleButtonClick()
 {
     MainButton.Text.text    = currentAction.line;
     MainButton.Speaker.text = currentAction.speaker;
     actionIndex++;
     if (currentAction.type == "choice")
     {
         foreach (string Choice in currentAction.choices)
         {
             int        SceneNumber = ListOfScenes.FindNextSceneIndex(Choice);
             NovelScene Scene       = ListOfScenes.FindNextScene(Choice);
             string     buttonText  = Scene.scene.buttonText;
             var        go          = Instantiate(MainButton);
             var        button      = GetComponent <UnityEngine.UI.Button>();
             button.onClick.AddListener(() => HandleNextScene(SceneNumber));
         }
     }
     //HandleNextScene();
 }