void RCC_AICarController_OnRCCAIDestroyed(RCC_AICarController RCCAI) { if (allVehicles.Contains(RCCAI.carController)) { allVehicles.Remove(RCCAI.carController); } }
void RCC_AICarController_OnRCCAISpawned(RCC_AICarController RCCAI) { if (!allVehicles.Contains(RCCAI.carController)) { allVehicles.Add(RCCAI.carController); } }
void RCC_AICarController_OnRCCAISpawned(RCC_AICarController RCCAI) { if (!allVehicles.Contains(RCCAI.carController)) { allVehicles.Add(RCCAI.carController); allRecorders = new List <RCC_Recorder> (); allRecorders.AddRange(gameObject.GetComponentsInChildren <RCC_Recorder> ()); RCC_Recorder recorder = new RCC_Recorder(); if (allRecorders != null && allRecorders.Count > 0) { for (int i = 0; i < allRecorders.Count; i++) { if (allRecorders [i] != null && allRecorders [i].carController == RCCAI.carController) { recorder = allRecorders [i]; break; } } } if (recorder == null) { recorder = gameObject.AddComponent <RCC_Recorder> (); recorder.carController = RCCAI.carController; } } StartCoroutine(CheckMissingRecorders()); }
public override void OnInspectorGUI() { serializedObject.Update(); aiController = (RCC_AICarController)target; if (!aiController.gameObject.GetComponent <RCC_CarControllerV3>().AIController) { aiController.gameObject.GetComponent <RCC_CarControllerV3>().AIController = true; } // if(aiController.gameObject.GetComponent<RCC_CarControllerV3>().canEngineStall) // aiController.gameObject.GetComponent<RCC_CarControllerV3>().canEngineStall = false; // // if(!aiController.gameObject.GetComponent<RCC_CarControllerV3>().autoReverse) // aiController.gameObject.GetComponent<RCC_CarControllerV3>().autoReverse = true; EditorGUILayout.Separator(); EditorGUILayout.BeginHorizontal(); GUILayout.Box(AIIcon, GUILayout.ExpandWidth(true)); EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); EditorGUILayout.PropertyField(serializedObject.FindProperty("_AIType"), new GUIContent("AI Type", "AI Type."), false); if (aiController._AIType == RCC_AICarController.AIType.FollowWaypoints) { EditorGUILayout.PropertyField(serializedObject.FindProperty("waypointsContainer"), new GUIContent("Waypoints Container", "Waypoints Container."), false); } else { EditorGUILayout.PropertyField(serializedObject.FindProperty("targetChase"), new GUIContent("Target For Chase", "Target For Chase."), false); } EditorGUILayout.PropertyField(serializedObject.FindProperty("obstacleLayers"), new GUIContent("Obstacle Layers", "Obstacle Layers For Avoid Dynamic Objects."), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("wideRayLength"), new GUIContent("Wide Ray Distance", "Wide Rays For Avoid Dynamic Objects."), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("tightRayLength"), new GUIContent("Tight Ray Distance", "Tight Rays For Avoid Dynamic Objects."), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("sideRayLength"), new GUIContent("Side Ray Distance", "Side Rays For Avoid Dynamic Objects."), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("limitSpeed"), new GUIContent("Limit Speed", "Limits The Speed."), false); if (aiController.limitSpeed) { EditorGUILayout.Slider(serializedObject.FindProperty("maximumSpeed"), 0f, aiController.GetComponent <RCC_CarControllerV3>().maxspeed); } EditorGUILayout.PropertyField(serializedObject.FindProperty("smoothedSteer"), new GUIContent("Smooth Steering", "Smooth Steering."), false); EditorGUILayout.PropertyField(serializedObject.FindProperty("nextWaypointPassRadius"), new GUIContent("Next Waypoint Pass Radius", "If car gets closer then this radius, goes to next waypoint."), false); EditorGUILayout.Separator(); EditorGUILayout.LabelField("Current Waypoint: ", aiController.currentWaypoint.ToString()); EditorGUILayout.LabelField("Laps: ", aiController.lap.ToString()); EditorGUILayout.LabelField("Total Waypoints Passed: ", aiController.totalWaypointPassed.ToString()); EditorGUILayout.LabelField("Ignoring Waypoint Due To Unexpected Obstacle: ", aiController.ignoreWaypointNow.ToString()); EditorGUILayout.Separator(); serializedObject.ApplyModifiedProperties(); }
void RCC_AICarController_OnRCCAIDestroyed(RCC_AICarController RCCAI) { if (allVehicles.Contains(RCCAI.carController)) { allVehicles.Remove(RCCAI.carController); } StartCoroutine(CheckMissingRecorders()); }
void Start() { AI = GetComponentInParent <RCC_AICarController> (); }