Ejemplo n.º 1
0
    // public Animator movingDoorController;

    private void OnTriggerEnter(Collider c)
    {
        // inlcude a check here for a keycard
        kc = player.GetComponent <KeyCardCollector>();
        if (c.CompareTag("Player") && kc.HasKey(thisDoorsKey))
        {
            Debug.Log("Player has entered Door Collider");
            movingDoorController.SetBool("playerEnter", true);
        }
    }
    void takeCard()
    {
        Debug.Log("Key is being taken and stored away");
        KeyCardCollector kc = playerObject.GetComponent <KeyCardCollector>();

        if (kc != null)
        {
            Debug.Log("kc is not null proceeding to take the card");
            kc.ReceiveKey(keyID);
            Destroy(this.gameObject);
        }
    }