public static void SetSteeringController(SteeringController controller) { currentSteeringController = controller; if (setSteeringController != null) { setSteeringController(controller); } }
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); }
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; } }
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; } }