public void ThrowCarryingObject() { m_PickedUpObject.Throw(m_Character); m_PickedUpObject = null; m_MovementModel.SetFrozen(false, false, false); m_MovementModel.SetIsAbleToAttack(true); }
public void ThrowCarryingObject() { Collider2D pickupObjectCollider = m_PickedUpObject.GetComponent <Collider2D>(); if (pickupObjectCollider != null) { pickupObjectCollider.enabled = true; Physics2D.IgnoreCollision(m_Collider, pickupObjectCollider); } m_PickedUpObject.Throw(m_Character); m_PickedUpObject = null; //m_MovementModel.SetFrozen( false, false, false ); m_MovementModel.SetIsAbleToAttack(true); }
IEnumerator _ThrowCarryingObject() { Collider2D pickupObjectCollider = m_PickedUpObject.GetComponent <Collider2D>(); if (pickupObjectCollider != null) { Physics2D.IgnoreCollision(m_Collider, pickupObjectCollider); pickupObjectCollider.enabled = false; } m_PickedUpObject.Throw(m_Character); yield return(new WaitForSeconds(0.2f)); pickupObjectCollider.enabled = true; Physics2D.IgnoreCollision(m_Collider, pickupObjectCollider, false); m_PickedUpObject = null; }
public void ThrowObject() { source.clip = throwSound; source.Play(); Collider2D pickupObjectCollider = pickedUpObject.GetComponent <Collider2D>(); if (pickupObjectCollider != null) { pickupObjectCollider.enabled = true; Physics2D.IgnoreCollision(m_collider, pickupObjectCollider); } pickedUpObject.Throw(character); pickedUpObject = null; movementModel.SetAbleToAttack(true); }
//Throws the currently being carried object public void ThrowCarryingObject() { Collider2D pickupObjectCollider = m_PickedUpObject.GetComponent <Collider2D>(); //Re-enable the collider and ignore collisions as your throw it if (pickupObjectCollider != null) { pickupObjectCollider.enabled = true; Physics2D.IgnoreCollision(m_Collider, pickupObjectCollider); } //Throoow it m_PickedUpObject.Throw(m_Character); m_PickedUpObject = null; //No longer carrying, can attack m_MovementModel.SetIsAbleToAttack(true); }
public void ThrowCarryingObject(bool dropped) { Collider2D pickupObjectCollider = m_PickedUpObject.GetComponent <Collider2D>(); if (pickupObjectCollider != null) { pickupObjectCollider.enabled = true; Physics2D.IgnoreCollision(m_Collider, pickupObjectCollider); } m_PickedUpObject.Throw(m_Character, dropped); if (dropped == true) { StartCoroutine(SetLayer(m_PickedUpObject.transform, "Default", 1f)); } //m_MovementModel.SetFrozen( false, false, false ); Physics2D.IgnoreCollision(m_Collider, pickupObjectCollider, false); SetUncarry(); }