internal void SetLocomotor(LocomotorSetType type) { if (!_locomotors.TryGetValue(type, out var locomotor)) { var locomotorSet = GameObject.Definition.LocomotorSets.Find(x => x.Condition == type); locomotor = (locomotorSet != null) ? new Locomotor(GameObject, locomotorSet) : null; } _currentLocomotor = locomotor; }
internal void SetLocomotor(LocomotorSetType type) { if (_currentLocomotorSetType == type) { return; } if (!GameObject.Definition.LocomotorSets.TryGetValue(type, out var locomotorSetTemplate)) { return; } _locomotorSet.Reset(); _locomotorSet.Initialize(locomotorSetTemplate); // TODO: Use actual surface type. CurrentLocomotor = _locomotorSet.GetLocomotorForSurfaces(Surfaces.Ground); }
internal AIUpdate(GameObject gameObject, AIUpdateModuleData moduleData) { GameObject = gameObject; _moduleData = moduleData; TargetPoints = new List <Vector3>(); _stateMachine = new AIStateMachine(); _locomotorSet = new LocomotorSet(gameObject); _currentLocomotorSetType = (LocomotorSetType)(-1); SetLocomotor(LocomotorSetType.Normal); if (_moduleData.Turret != null) { _turretAIUpdate = _moduleData.Turret.CreateTurretAIUpdate(GameObject); } }