Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == "tongsPosition" && !lockedIn)
        {
            lockedIn = true;
            pickupObject.Drop();
            pickupObject.Drop();

            transform.position    = other.transform.position;
            transform.rotation    = other.transform.rotation;
            transform.parent      = other.transform.parent;
            rigidbody.isKinematic = true;
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        //collecting tea
        if (other.name.Contains("TeaLeaves"))
        {
            //print("tea collected");
            teaCollected     = true;
            teaClump.enabled = true;
        }
        else if (other.name.Contains("teapotLeafDrop"))
        {
            inRange = true;
        }
        else if (other.name == "scoopPosition" && !lockedIn)
        {
            lockedIn = true;
            if (pickupObject.pickedUpObject == gameObject)
            {
                pickupObject.Drop();
            }

            transform.position    = other.transform.position;
            transform.rotation    = other.transform.rotation;
            transform.parent      = other.transform.parent;
            rigidbody.isKinematic = true;
        }
    }
Ejemplo n.º 3
0
 private void Drop()
 {
     if (IsItemHeld())
     {
         _heldItem.Drop();
         _heldItem = null;
     }
 }
Ejemplo n.º 4
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "OtherPickup" || other.tag == "Teacup" || other.tag == "Teapot" || other.tag == "Pitcher" || other.tag == "Scoop" || other.tag == "Tongs")
        {
            if (other.gameObject == pickupObject.pickedUpObject)
            {
                pickupObject.Drop();
            }

            other.transform.position = respawnPosition;
        }
    }
Ejemplo n.º 5
0
 private void Drop()
 {
     if (IsItemHeld())
     {
         _heldItem.Drop();
         _heldItem = null;
     }
     else
     {
         AddReward(-0.01f);
     }
 }
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == "containerLidPosition" && !lockedIn)
        {
            if (pickupObject.pickedUpObject == gameObject)
            {
                pickupObject.Drop();
            }

            transform.position    = other.transform.position;
            transform.parent      = other.transform.parent;
            rigidbody.isKinematic = true;
            lockedIn = true;
        }
    }
Ejemplo n.º 7
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == "teapotLidPosition" && !lockedIn)
        {
            if (pickupObject.pickedUpObject == gameObject)
            {
                pickupObject.Drop();
            }

            transform.position = other.transform.position;
            transform.parent   = other.transform.parent;
            other.transform.parent.GetComponent <TeapotScript>().topOn = true;
            rigidbody.isKinematic = true;
            lockedIn = true;
        }
    }