コード例 #1
0
 // Update is called once per frame
 private void Update()
 {
     if (this.completed)
     {
         this.hidePlayerResponses();
         if (npcText.text != string.Empty)
         {
             Invoke("hideNpcResponse", 3);
         }
     }
     if (this.started && !this.completed)
     {
         this.currentNpcDialog.fixedUpdate();
         NPCDialog continuation = this.currentNpcDialog.getNPCCountinuation();
         if (continuation && this.canStartNextLine)
         {
             this.currentNpcDialog = continuation;
             StartCoroutine(fireNextLine(this.currentNpcDialog.npcResponse));
             this.completed        = !this.currentNpcDialog.HasPossibleResponses();
             this.canStartNextLine = false;
         }
         else if (!continuation && !this.currentNpcDialog.getPlayerResponse() && this.canStartNextLine)
         {
             this.updatePlayerResponses();
         }
         else if (this.currentNpcDialog.getPlayerResponse() && this.canStartNextLine)
         {
             this.hidePlayerResponses();
             PlayerDialog playerDialog = this.currentNpcDialog.getPlayerResponse();
             this.currentNpcDialog = playerDialog.getNpcResponse();
             if (this.currentNpcDialog)
             {
                 this.npcText.text = this.currentNpcDialog.npcResponse;
                 this.completed    = !this.currentNpcDialog.HasPossibleResponses();
             }
             else
             {
                 this.completed = true;
             }
             if (this.completed)
             {
                 Invoke("hideNpcResponse", 3);
                 this.hidePlayerResponses();
             }
         }
     }
 }