Esempio n. 1
0
    void FixedUpdate()
    {
        GetVisionTargets();
        GetBehaviorPriority();

        Vector3 accel = Vector3.zero;

        switch (behaviorState)
        {
        case BehaviorState.WANDER:
            accel = steering.GetSteeringWander();
            break;

        case BehaviorState.SEEK:
            accel = steeringBasics.SeekEnemy(faction2.transform.position);
            break;

        case BehaviorState.ARRIVE:
            accel = Arrive();
            break;

        case BehaviorState.FLEE:
            accel = steering.GetSteeringFlee(faction2.transform.position);
            break;

        case BehaviorState.FLOCK:
            accel = steering.Flock(accel);
            break;

        case BehaviorState.CAPTURE:
            accel = Capture();
            break;

        default:
            Debug.Log("Unknown State");
            break;
        }
        steeringBasics.Steer(accel);
        steeringBasics.LookWhereYoureGoing();
    }