Пример #1
0
    /// <summary>Called when [trigger stay2 d].</summary>
    /// <param name="obj">The object.</param>
    public void OnTriggerStay2D(Collider2D obj)
    {
        if (obj.CompareTag("Player") && !isOpen)
        {
            keyChain = obj.GetComponent <Keychain>();
            if (keyChain.CanSpendAKey())
            {
                canOpen = true;
            }

            keyChain.ActiveUI();
            warningNeedKey.SetActive(true);
        }
        else
        {
            canOpen = false;
        }
    }