Beispiel #1
0
        void FixedUpdate()
        {
            Vector3 accel = flee.GetSteering(target.position);

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #2
0
        void FixedUpdate()
        {
            Vector3 accel = evade.GetSteering(target);

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #3
0
        void FixedUpdate()
        {
            Vector3 accel = steeringBasics.Arrive(target.transform.position);

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #4
0
        void FixedUpdate()
        {
            Vector3 accel = steeringBasics.Interpose(target1, target2);

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #5
0
        void FixedUpdate()
        {
            Vector3 accel = wander.GetSteering();

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #6
0
        void FixedUpdate()
        {
            if (target != null)
            {
                Vector3 accel = steeringBasics.Seek(target.position);

                steeringBasics.Steer(accel);
                steeringBasics.LookWhereYoureGoing();
            }
        }
Beispiel #7
0
        void FixedUpdate()
        {
            Vector3 accel = colAvoid.GetSteering(colAvoidSensor.targets);

            if (accel.magnitude < 0.005f)
            {
                accel = wander.GetSteering();
            }

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #8
0
        void FixedUpdate()
        {
            path.Draw();

            if (reversePath && followPath.IsAtEndOfPath(path))
            {
                path.ReversePath();
            }

            Vector3 accel = followPath.GetSteering(path, pathLoop);

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #9
0
        void FixedUpdate()
        {
            Vector3 hidePosition;
            Vector3 hideAccel = hide.GetSteering(target, obstacleSpawner.objs, out hidePosition);

            Vector3 accel = wallAvoid.GetSteering(hidePosition - transform.position);

            if (accel.magnitude < 0.005f)
            {
                accel = hideAccel;
            }

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Beispiel #10
0
        void FixedUpdate()
        {
            Vector3 accel = Vector3.zero;

            accel += cohesion.GetSteering(sensor.targets) * cohesionWeight;
            accel += separation.GetSteering(sensor.targets) * separationWeight;
            accel += velocityMatch.GetSteering(sensor.targets) * velocityMatchWeight;

            if (accel.magnitude < 0.005f)
            {
                accel = wander.GetSteering();
            }

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
        void LateUpdate()
        {
            Vector3 targetPos;
            Vector3 offsetAccel = offsetPursuit.GetSteering(target, offset, out targetPos);
            Vector3 sepAccel    = separation.GetSteering(sensor.targets);

            steeringBasics.Steer(offsetAccel + sepAccel);

            /* If we are still arriving then look where we are going, else look the same direction as our formation target */
            if (Vector3.Distance(transform.position, targetPos) > groupLookDist)
            {
                steeringBasics.LookWhereYoureGoing();
            }
            else
            {
                steeringBasics.LookAtDirection(target.Rotation);
            }
        }
Beispiel #12
0
        void FixedUpdate()
        {
            path.Draw();

            if (followPath.IsAtEndOfPath(path))
            {
                path.ReversePath();
            }

            Vector3 accel = colAvoid.GetSteering(colAvoidSensor.targets);

            if (accel.magnitude < 0.005f)
            {
                accel = followPath.GetSteering(path);
            }

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }