Exemplo n.º 1
0
    public IEnumerator Switching()
    {
        MessageWindow messageWindow = MessageSystem.GetWindow();

        PlayerInteract.InteractableStart();

        //スイッチがオンのときオフに切り替える
        //Switch off when switch is on
        if (isOnSwitch)
        {
            isOnSwitch            = false;
            spriteRenderer.sprite = offImage;
            OffSwitch.Invoke();

            yield return(new WaitForSeconds(wait));

            yield return(StartCoroutine(messageWindow.ShowClick(offMessage)));
        }
        else
        {
            isOnSwitch            = true;
            spriteRenderer.sprite = onImage;
            OnSwitch.Invoke();

            yield return(new WaitForSeconds(wait));

            yield return(StartCoroutine(messageWindow.ShowClick(onMessage)));
        }

        messageWindow.Close();
        PlayerInteract.InteractableEnd();
        yield break;
    }
Exemplo n.º 2
0
    public IEnumerator OpenBox()
    {
        MessageWindow messageWindow = MessageSystem.GetWindow();

        PlayerInteract.InteractableStart();

        if (isOpen)
        {
            yield return(StartCoroutine(messageWindow.ShowClick("からっぽだ")));

            messageWindow.Close();
            PlayerInteract.InteractableEnd();
            yield break;
        }

        //お金が入っていた
        if (money > 0)
        {
            yield return(GetMony());
        }

        //アイテムが入っていた
        if (item != null)
        {
            yield return(GetItem());
        }

        //装備が入っていた
        if (equipment != null)
        {
            yield return(GetEqip());
        }

        //フラグの保存
        VariablePersister.SetBool(key, true);

        PlayerInteract.InteractableEnd();
        yield break;
    }
Exemplo n.º 3
0
    public IEnumerator Talk()
    {
        MessageWindow messageWindow = MessageSystem.GetWindow();

        PlayerInteract.InteractableStart();

        //会話文章の表示
        //display talk
        List <string> content = conversation;

        foreach (var item in content)
        {
            yield return(new WaitForEndOfFrame());

            yield return(StartCoroutine(messageWindow.ShowClick(item)));

            yield return(new WaitForEndOfFrame());
        }
        messageWindow.Close();

        PlayerInteract.InteractableEnd();
    }
Exemplo n.º 4
0
 public void Close()
 {
     PlayerInteract.InteractableEnd();
 }
Exemplo n.º 5
0
 private void OnDisable()
 {
     //PlayerMovement.canMove = true;
     PlayerInteract.InteractableEnd();
 }