Ejemplo n.º 1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.gameObject.GetComponent <TestingPile>())
        {
            currentPile = other.gameObject.GetComponent <TestingPile>();
            if (!holdingItem)
            {
                canPickUp = 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 <TestingGoalVTwo>())
        {
            currentGoal = other.gameObject.GetComponent <TestingGoalVTwo>();
            if (holdingItem && holding == other.gameObject.GetComponent <TestingGoalVTwo>().whatDoINeed /* && other.gameObject.GetComponent<TestingGoalVTwo>().objectsPlaced < other.gameObject.GetComponent<TestingGoalVTwo>().objectsNeeded && !other.gameObject.GetComponent<TestingGoalVTwo>().sabotaged*/)
            {
                canDeliver = true;
            }
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.GetComponent <TestingPile>())
        {
            canPickUp   = false;
            currentPile = null;
        }

        /*
         * if (other.gameObject.GetComponent<TestingGoal>() && holdingItem)
         * {
         *  canDeliver = false;
         *  currentGoal = null;
         * }
         */
        if (other.gameObject.GetComponent <TestingGoalVTwo>() && holdingItem)
        {
            canDeliver  = false;
            currentGoal = null;
        }
    }