Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            // Add this Key to our KeyChain
            // Play a pick-up SFX
            keyChain.AddKey(this);

            this.gameObject.SetActive(false);
        }
    }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            keyChain = other.GetComponent <KeyChain>();
            // Add this Key to our KeyChain
            // Play a pick-up SFX
            keyChain.AddKey(this);
            Debug.Log("You picked up the " + keyName + ". and add it to your Keychain");

            this.gameObject.SetActive(false);
        }
    }