public void UnLock(Player player)
 {
     if (player.GetItemFlag(Player.Item.Key))
     {
         isOpen = true;
         SetOpen();
         GameManager.PlayAudioOneShot("key");
         // GameManager.audioController.PlayOneShot(7);
         textCanvas.ShowMessage("鍵を使った。", true);
     }
     else
     {
         Locked("鍵がかかっている。");
     }
 }
 public void Check()
 {
     if (unityEvent != null)
     {
         unityEvent.Invoke();
     }
     itemImage.sprite = sprite;
     itemImage.gameObject.SetActive(true);
     GameManager.PlayAudioOneShot("decide");
     // GameManager.audioController.PlayOneShot(3);
     player.SetItemFlag(item);
     textCanvas.ShowMessage(text, false);
 }
 public void Check()
 {
     if (targetCanvas != null)
     {
         targetCanvas.SetActive(true);
     }
     if (showMessage)
     {
         textCanvas.ShowMessage(message);
     }
     if (unityEvent != null)
     {
         unityEvent.Invoke();
     }
     eventCanvas.image.sprite   = sprite;
     eventCanvas.canvas.enabled = true;
     buttonText.text            = "戻る";
     button.onClick.RemoveAllListeners();
     button.onClick.AddListener(() => CheckFinish());
 }
Esempio n. 4
0
    // 選択肢を表示
    public void ShowQuestionAnswer(GameObject buttons)
    {
        Player player = FrontSceneManager.player;

        if (!player.TVFlag)
        {
            // テレビを見てなければ答えられない
            textCanvas.ShowMessage("テレビの絵柄が描かれたパネルだ。問いの答えは検討もつかない。");
        }
        else if (!doorEvent.isOpen)
        {
            for (int i = 0; i < people.Length; i++)
            {
                string name = people[i].name;
                eventCanvas.MakeButton(i, name, () => TextCheck(name, buttons));
            }
            textCanvas.ShowMessage("幽霊は・・・");
            StartCoroutine(WaitDeleteMessage(buttons));
        }
        else if (player.roomFlag && !picture.activeInHierarchy)
        {
            if (player.diaryFlag)
            {
                textCanvas.ShowMessage("リサ・・・あの日記に名前があったな。\nならば答えはおそらく・・・");
                eventCanvas.MakeButton(0, "ナナミ", () => OnPicture(buttons));
                StartCoroutine(WaitDeleteMessage(buttons));
            }
            else
            {
                textCanvas.ShowMessage("リサって誰だ?");
            }
        }
        else
        {
            textCanvas.ShowMessage("ここにもう用はない。");
        }
    }