예제 #1
0
    void Update()
    {
        switch (myState)
        {
        case joggState.resting:
            float distance = Vector3.Distance(transform.position, bed.transform.position);

            if (distance < 1)
            {
                currentEnergy += energyDrain * Time.deltaTime;
            }
            break;

        case joggState.jogging:
            agent.destination = wander.returnWanderPoints();
            break;
        }
        switchStates();
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        switch (currentState)
        {
        case States.WANDERSTATE:
            agent.destination = wander.returnWanderPoints();
            break;

        case States.SEEK:
            agent.destination = seek.returnFleeVector();
            break;

        case States.STARTOVERSTATE:

            break;

        case States.FLEESTATE:
            agent.destination = flee.returnFleeVector();
            break;
        }
    }