예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Exit)
        {
            desk.GetComponent <Animator>().SetBool("disappear", true);
            ExitTime -= Time.deltaTime;
            if (ExitTime < 0)
            {
                desk.SetActive(false);
                Exit = false;
            }
        }
        else
        {
            ExitTime = 0;
        }

        if (playerStay) //jest to dodatkowe zabezpieczenie w razie jakby OnTriggerStary2D nie zadziałał
        {
            if (Input.GetKeyDown(keyMenager.keys["Action"]))
            {
                chestUI.OpenChest();
                visited = true;
                anim.SetBool("NoVisited", false);
                if (particle.active)
                {
                    particle.SetActive(false);
                }
            }
        }
    }
예제 #2
0
 void Update()
 {
     if (interactable)
     {
         if (Input.GetButtonDown("Interact") && playerScript.playerState != Player.PlayerState.Inventory)
         {
             chestUI.OpenChest(this);
         }
     }
 }