Exemplo n.º 1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.GetComponent <Pile>())
        {
            canPickUp   = false;
            currentPile = null;
            spyPickup.SetBool("IsIdle", true);
            civillianAnim.SetBool("IsIdle", true);
            deliveryPickupTimer = pickupTime;
        }

        /*
         * if (other.gameObject.GetComponent<TestingGoal>() && holdingItem)
         * {
         *  canDeliver = false;
         *  currentGoal = null;
         * }
         */
        if (other.gameObject.GetComponent <PileGoal>() && holdingItem)
        {
            canDeliver  = false;
            currentGoal = null;
            spyPickup.SetBool("IsIdle", true);
            civillianAnim.SetBool("IsIdle", true);
            deliveryPickupTimer = deliveryTime;
        }
        else if (other.gameObject.GetComponent <PileGoal>())
        {
            currentGoal = null;
            spyPickup.SetBool("IsIdle", true);
            civillianAnim.SetBool("IsIdle", true);
            deliveryPickupTimer = deliveryTime;
        }
    }
Exemplo n.º 2
0
 public void RpcPutOnGoal(string item, string role)
 {
     if (item == "Leaf")
     {
         leafObj.SetActive(false);
     }
     else if (item == "Stick")
     {
         stickObj.SetActive(false);
     }
     currentGoal.PlayerGiveItem(item, role);
     holding              = null;
     canDeliver           = false;
     holdingItem          = false;
     currentGoal          = null;
     deliverPickupTrigger = false;
 }
Exemplo n.º 3
0
    /*void PickUpObject(GameObject objectToHold)
     * {
     *  currentPile = null;
     *  GameObject objClone = Instantiate(objectToHold, holdPoint);
     *  objClone.GetComponent<Rigidbody>().isKinematic = true;
     *  objectHolding = objClone;
     *  holdingItem = true;
     * }*/

    private void OnTriggerStay(Collider other)
    {
        if (other.gameObject.GetComponent <Pile>())
        {
            currentPile = other.gameObject.GetComponent <Pile>();
            if (!holdingItem)
            {
                canPickUp = true;
                spyPickup.SetBool("IsIdle", false);
                civillianAnim.SetBool("IsIdle", false);
            }
            else
            {
                canPickUp = false;
                spyPickup.SetBool("IsIdle", true);
                civillianAnim.SetBool("IsIdle", true);
            }
        }

        /*
         * if (other.gameObject.GetComponent<TestingGoal>())
         * {
         *  currentGoal = other.gameObject.GetComponent<TestingGoal>();
         *  if (holdingItem && holding == other.gameObject.GetComponent<TestingGoal>().need && other.gameObject.GetComponent<TestingGoal>().objectsPlaced < 6 && !other.gameObject.GetComponent<TestingGoal>().sabotaged)
         *  {
         *      canDeliver = true;
         *  }
         * }
         */
        if (other.gameObject.GetComponent <PileGoal>())
        {
            currentGoal = other.gameObject.GetComponent <PileGoal>();
            if (holdingItem && holding == other.gameObject.GetComponent <PileGoal>().whatDoINeed /* && other.gameObject.GetComponent<TestingGoalVTwo>().objectsPlaced < other.gameObject.GetComponent<TestingGoalVTwo>().objectsNeeded && !other.gameObject.GetComponent<TestingGoalVTwo>().sabotaged*/)
            {
                canDeliver = true;
                civillianAnim.SetBool("IsIdle", false);
            }
        }
    }