private void Action() { if (interactable != null) { interactable.Pickup(gameObject); } }
private void Update() { if (playerInput.ButtonIsDown(PlayerInput.Button.B)) { DropItem(); } if (Input.GetKey(KeyCode.I) || playerInput.ButtonIsDown(PlayerInput.Button.A)) { if (touchedInteractable != null) { touchedInteractable.Pickup(gameObject, this, this.playerState); return; } if (playerState.playerState == PlayerStates.PlayerState.pBucket && touchedGameObject.CompareTag("Edge")) { if (bucketStates.currentState == BucketStates.BucketState.Held) { bucketStates.currentState = BucketStates.BucketState.Bailing; } } if (currentObject && touchedGameObject) { currentObject.Activate(touchedGameObject); } if (touchedGameObject) { HunkerDown hunkerDown = touchedGameObject.gameObject.GetComponent <HunkerDown>(); if (hunkerDown != null) { Debug.Log("Holding"); hunkerDown.Pickup(this.gameObject); } } } }