public void Pickup(JoeJeffCarriable carry) { audio.PlayOneShot(au_pickup); carrying = carry; carrying.Pickup(this); carrying.transform.position = carrying.GetPositionTarget(carryAnchor); carrying.transform.rotation = carrying.GetRotationTarget(carryAnchor); }
public void Drop() { if (carrying != null) { carrying.Drop(); carrying = null; } }
private void OnTriggerEnter(Collider other) { if (canPickup == false) { return; } //if we detect a carriable, JoeJeffCarriable carry = other.GetComponent <JoeJeffCarriable>(); if (carry != null) { if (carry.carried == false) { Pickup(carry); } } }