public override void OnInteract(Character character)
 {
     if (QuestionBox.IsVisible())
     {
         if (isChecked)
         {
             QuestionBox.Hide();
         }
         else
         {
             isChecked = true;
             QuestionBox.CheckAnswer();
         }
     }
     else
     {
         if (!isSeen)
         {
             QuestionBox.Uncheck();
         }
         isSeen = true;
         QuestionBox.ShowQuestion(myText);
         character.Behavior.setFrozen(true, true);
     }
 }
示例#2
0
    void UpdateAction()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            OnActionPressed();
        }
        else if (QuestionBox.IsVisible())
        {
            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                QuestionBox.LowerSelection();
            }

            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                QuestionBox.GoUpSelection();
            }
        }
        else if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (isPaused)
            {
                ResumeGame();
            }
            else
            {
                GameObject.FindGameObjectWithTag("MainCamera").GetComponent <FMODUnity.StudioEventEmitter> ().SetParameter("paused", 1f);
                isPaused = true;
                pausePannel.SetActive(true);
                pausePannel.GetComponent <PauseUI>().Select();
                pauseFrozen = isFrozen;
                setFrozen(true, true);
            }
        }
    }