コード例 #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;
        }
    }
コード例 #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;
        }
    }
コード例 #3
0
ファイル: MoverAgent.cs プロジェクト: BantamJoe/MoverBots
 private void Drop()
 {
     if (IsItemHeld())
     {
         _heldItem.Drop();
         _heldItem = null;
     }
 }
コード例 #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;
        }
    }
コード例 #5
0
ファイル: MoverAgent.cs プロジェクト: mellinoe/MoverBots
 private void Drop()
 {
     if (IsItemHeld())
     {
         _heldItem.Drop();
         _heldItem = null;
     }
     else
     {
         AddReward(-0.01f);
     }
 }
コード例 #6
0
    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;
        }
    }
コード例 #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;
        }
    }