public void CollectItem(ICollectble collectble) { if (currentCollectble != null && currentCollectble.IsBeingHeld) { currentCollectble.Drop(); } currentCollectble = collectble; CollectItem(); animator.SetBool(IS_HOLDING_ITEM, true); }
public void ReceiveCollectble(ICollectble collectble) { if (currentCollectble != null || collectble.Group != Group) { AudioController.Instance.Play(wrongSphere, AudioController.SoundType.SoundEffect2D); return; } AudioController.Instance.Play(plugAudio, AudioController.SoundType.SoundEffect2D); collectble.OnReceived(this); currentCollectble = collectble; renderer.sprite = activeSprite; animator.SetTrigger(CHANGE_CAP); SetDependentObjectsActive(true); }
public void RemoveCollectble(PlayerInteractBehaviour player) { if (currentCollectble == null) { return; } AudioController.Instance.Play(plugAudio, AudioController.SoundType.SoundEffect2D); currentCollectble.OnRemovedFromReceiver(); player.CollectItem(currentCollectble); currentCollectble = null; renderer.sprite = inactiveSprite; animator.SetTrigger(CHANGE_CAP); SetDependentObjectsActive(false); }
public void OnDropItem() { currentCollectble = null; movement.canDoubleJump = true; animator.SetBool(IS_HOLDING_ITEM, false); }