コード例 #1
0
        protected override void SetupStates()
        {
            SetAwareness(areaAwareness);

            State patrol       = new Patrol(this, patrolData);
            State followTarget = new FollowTarget(this);

            Transition patrolToFollow = new HasTarget(followTarget, areaAwareness);
            Transition followToPatrol = new TargetIsFar(patrol, distanceToStopFollowing, areaAwareness);

            patrol.SetTransitions(patrolToFollow);
            followTarget.SetTransitions(followToPatrol);

            SetupFirstState(patrol);
        }