Ejemplo n.º 1
0
        void FixedUpdate()
        {
            path.Draw();

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

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

            steeringBasics.Steer(accel);
            steeringBasics.LookWhereYoureGoing();
        }
Ejemplo n.º 2
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();
        }