コード例 #1
0
 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);
 }
コード例 #2
0
 public void Drop()
 {
     if (carrying != null)
     {
         carrying.Drop();
         carrying = null;
     }
 }
コード例 #3
0
    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);
            }
        }
    }