public void UnAim() { CarryItemEnd?.Invoke(); isCarryingItem = false; m_isAiming = false; m_animator?.SetBool("PickedUp", false); m_ui.DeactivateAim(this); m_pickedUp = null; }
private void PutDown() { if (m_pickedUp != null && !m_isAiming) { m_pickedUp.PutDown(); m_pickedUp = null; m_animator?.SetBool("PickedUp", false); isCarryingItem = false; CarryItemEnd?.Invoke(); } }
private void Throw() { aus.PlayOneShot(Resources.Load("Sounds/Throw") as AudioClip); if (m_pickedUp != null && isCarryingItem == true) { CarryItemEnd?.Invoke(); m_animator?.SetBool("PickedUp", false); m_ui.DeactivateAim(this); var angle = TurnToSide == Side.Left ? 180 - m_aimAngle : m_aimAngle; var force = Quaternion.Euler(0, 0, angle) * Vector2.right * m_aimStrength; m_pickedUp.Throw(force); m_isAiming = false; isCarryingItem = false; m_pickedUp = null; } if (m_ui != null) { m_ui.DeactivateAim(this); } }