コード例 #1
0
 public static void SetSteeringController(SteeringController controller)
 {
     currentSteeringController = controller;
     if (setSteeringController != null)
     {
         setSteeringController(controller);
     }
 }
コード例 #2
0
        void OnSetSteeringController(SteeringController controller)
        {
            // Exit the current steering controller.
            if (steeringController)
            {
                steeringController.Exit(ref controlReferences);
            }

            // Set new steering controller and initialize it.
            steeringController = controller;
            steeringController.Initialize(ref controlReferences);
        }
コード例 #3
0
        void OnSetSteeringController(SteeringController steeringController)
        {
            // Assume default values initially.
            SteerCharacteristics characteristics = defaultCharacteristics;

            // Search for the new SteeringController in specified values.
            if (steerCharacteristicDictionary.ContainsKey(steeringController.name))
            {
                characteristics = steerCharacteristicDictionary[steeringController.name];
            }

            // Set RollerBotVehicle steering
            if (rollerBotVehicle)
            {
                rollerBotVehicle.turnSmoothTime = characteristics.turnSmoothTime;
            }
        }
コード例 #4
0
        void OnSetSteeringController(SteeringController steeringController)
        {
            // Assume default values initially.
            SteerCharacteristics characteristics = defaultCharacteristics;

            // Search for the new SteeringController in specified values.
            if (steerCharacteristicDictionary.ContainsKey(steeringController.name))
            {
                characteristics = steerCharacteristicDictionary[steeringController.name];
            }

            // Set WheeledVehicle steering
            if (wheeledVehicle)
            {
                wheeledVehicle.maxTurnSpeed      = characteristics.maxTurnSpeed;
                wheeledVehicle.maxTurnSpeedAtMax = characteristics.maxTurnSpeedAtMax;
                wheeledVehicle.maxTurnAngle      = characteristics.maxTurnAngle;
                wheeledVehicle.maxTurnAngleAtMax = characteristics.maxTurnAngleAtMax;
            }
        }