예제 #1
0
        public virtual Dialogue process()
        {
            if (!isStarted)
            {
                init("");
                if (currentChoice.dialogue != null)
                    Console.WriteLine(currentChoice.dialogue);
                isStarted = true;
                speechUpdated = true;
            }
            else
            {  // pauseFlag = false;
                //if (currentChoice != null)
                {

                    if (currentDialogue.GetChoices().Length > 1)
                    {
                        pauseFlag = true;
                        speechUpdated = true;

                    }
                    else
                    {
                        if (!pauseFlag && myAlpha > 0)
                        {
                            myAlpha = myAlpha - speedsmooth ;  /* Time.deltaTime;*/
                        }
                        else if (myAlpha <= 0)
                        {
                            if (currentDialogue.GetChoices().Length == 1)
                            {
                                //	if (GUILayout.Button("Next"))
                                currentChoice = null;
                                currentChoice = currentDialogue.GetChoices()[0];
                                if (currentChoice != null)
                                {
                                    currentDialogue.PickChoice(currentChoice);
                                    if (currentChoice.dialogue != null)
                                    {
                                        Console.WriteLine(currentChoice.dialogue);
                                        speechUpdated = true;
                                    }

                                }
                            }
                        }
                    }
                }
            }
            if (speechUpdated)
            {
                myAlpha = 5f;
                speechUpdated = false;
            }

            return currentDialogue;
        }
예제 #2
0
 public virtual void receive(Dialogue.Choice choice)
 {
     currentDialogue.PickChoice(choice);
     currentChoice = choice;
 }
예제 #3
0
        public virtual void init(string dialogueFile)
        {
            currentDialogue = GetDialogue("TutorialStart");
            currentChoice = currentDialogue.GetChoices()[0];

            currentDialogue.PickChoice(currentChoice);
            Console.WriteLine("dialogue initialized");
        }