protected override void Interact(Collider player) { InventoryCS inventory = player.GetComponent <InventoryCS>(); if (inventory != null && inventory.AddItem(item)) { Destroy(gameObject); } }
void Awake() { speed_ = speedBase; //_sneakEfficency = sneakBase; // Debug.Log ("Awake sneak " + _sneakBase); charController = GetComponent <CharacterController>(); charInventory = GetComponent <InventoryCS>(); targetObject = GameObject.Find("Door" + currentDoorKeyNeeded); target = targetObject.transform; if (_instance == null) { _instance = this; } }