Exemplo n.º 1
0
    public void LineEnd()         // endof sent text.
    {
        switch (currentTalkState) ///NOTE: when line is over!!
        {
        case TalkingState.hello:  // starting pulls up menu!
            ChoiceScript c = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <MainCanvasScript>().GetDisplay("Choice").GetComponent <ChoiceScript>();
            c.NewChoice(menu, 0, gameObject, "ChoiceMade");
            currentTalkState = TalkingState.menu;
            break;

        case TalkingState.chat:                // chat over. event check.
            currentTalkState = TalkingState.none;
            break;

        case TalkingState.keyword:                // keyword over. event/quest check
            currentTalkState = TalkingState.none;
            break;

        case TalkingState.nevermind:                // end. thats all.
            currentTalkState = TalkingState.none;
            break;

        case TalkingState.none:
            Debug.LogError("Line end when not talking!!");
            break;
        }
    }
 // compare choice local variable description to the other choice description, if true return
 public int GetChoiceIndex(GameObject[] choices, ChoiceScript choice)
 {
     for (int i = 0; i < choices.Length; i++)
     {
         if (choices[i].GetComponent <ChoiceScript>().description.Equals(choice.description))
         {
             return(i);
         }
     }
     return(-1);
 }
Exemplo n.º 3
0
    private void instChoice(string text, float time, string choice1, string choice2, string choice3, int skip1, int skip2, int skip3, int skip_time)
    {
        string[]     choice_array = { choice1, choice2, choice3 };
        int[]        skip_array   = { skip1, skip2, skip3, skip_time };
        ChoiceScript textbox      = Instantiate(Resources.Load <GameObject>("Text/Choicebox")).GetComponent <ChoiceScript>();

        textbox.em          = this;
        textbox.text        = text;
        textbox.choice_time = time;
        textbox.transform.SetParent(transform);
        textbox.GetComponent <RectTransform>().localPosition = new Vector3(0f, -575f, 0f);
        textbox.GetComponent <RectTransform>().localScale    = new Vector3(1f, 1f, 1f);
        textbox.addChoiceText(choice_array);
        textbox.skips          = skip_array;
        textbox.gameObject.tag = "Text";
    }
Exemplo n.º 4
0
 public void attackFinished()
 {
     gameIsPaused = true;
     animator.SetBool("isAttacking", false);
     ChoiceScript.animationIsFinished();
 }
Exemplo n.º 5
0
 public void attackFinished()
 {
     PlayerMovement.gameIsPaused = true;
     ChoiceScript.animationIsFinished();
 }