/// <summary> /// Sraw spawner Area Editor /// </summary> void DrawSpawnerAreaEditor() { // Make a space at the beginning of the editor GUILayout.Space(10); Color _originalColor = GUI.backgroundColor; GUI.backgroundColor = TDS_EditorUtility.BoxDarkColor; EditorGUILayout.BeginVertical("HelpBox"); TDS_EditorUtility.RadioToggle("Is Ready", "", isReady); TDS_EditorUtility.RadioToggle("Is Activated", "", isActivated); EditorGUILayout.EndVertical(); GUILayout.Space(10); EditorGUILayout.BeginVertical("HelpBox"); // Button to show or not the Character class settings if (TDS_EditorUtility.Button("Settings", "Wrap / unwrap settings", TDS_EditorUtility.HeaderStyle)) { AreSpawnerAreaSettingsUnfolded = !areSpawnerAreaSettingsUnfolded; } // If unfolded, draws the custom editor for the sttings if (areSpawnerAreaSettingsUnfolded) { DrawSettings(); } EditorGUILayout.EndVertical(); GUILayout.Space(15); GUI.backgroundColor = TDS_EditorUtility.BoxDarkColor; EditorGUILayout.BeginVertical("HelpBox"); // Button to show or not the Character class components if (TDS_EditorUtility.Button("Events", "Wrap / Unwrap Events settings", TDS_EditorUtility.HeaderStyle)) { AreSpawerAreaEventsUnfolded = !areSpawerAreaEventsUnfolded; } // If unfolded, draws the custom editor for the Components & References if (areSpawerAreaEventsUnfolded) { DrawEvents(); } EditorGUILayout.EndVertical(); GUILayout.Space(15); DrawSpawnedEnemies(); // Applies all modified properties on the SerializedObjects serializedObject.ApplyModifiedProperties(); GUI.backgroundColor = _originalColor; }
/// <summary> /// Draws the debugs editor of the TDS_Player editing objects. /// </summary> private void DrawDebugs() { TDS_EditorUtility.RadioToggle("Grounded", "Is this player on ground or not", isGrounded); TDS_EditorUtility.RadioToggle("Moving", "Is this player currently moving or not", isMoving); TDS_EditorUtility.RadioToggle("Jumping", "Is this player currently jumping or not", isJumping); TDS_EditorUtility.RadioToggle("Dodging", "Is this player currently dodging or not", isDodging); TDS_EditorUtility.RadioToggle("Preparing Attack", "Is this player currently preparing an attack", isPreparingAttack); TDS_EditorUtility.RadioToggle("Parrying", "Is this player currently parrying or not", isParrying); }
/// <summary> /// Draws the editor of the editing scripts. /// </summary> public override void DrawEditor() { // Make a space at the beginning of the editor GUILayout.Space(10); Color _originalColor = GUI.backgroundColor; Color _originalGUIColor = GUI.color; GUI.backgroundColor = TDS_EditorUtility.BoxDarkColor; EditorGUILayout.BeginVertical("HelpBox"); // Records any changements on the editing objects to allow undo Undo.RecordObjects(targets, "Event System settings"); // Updates the SerializedProperties to get the latest values serializedObject.Update(); GUILayout.Space(3); TDS_EditorUtility.RadioToggle("Activated", "Is this event system activated or not", isActivated); if (isActivated.boolValue) { GUILayout.Space(3); EditorGUILayout.LabelField(new GUIContent("Current Event", "Current event processing"), new GUIContent(currentEvent.FindPropertyRelative("Name").stringValue)); } GUILayout.Space(5); TDS_EditorUtility.Toggle("Des. Object when Finished", "Should this object be deactivated when the event system gets finished", doDesObjectOnFinish); GUILayout.Space(3); GUI.backgroundColor = _originalColor; TDS_EditorUtility.PropertyField("Detected Tags", "Tags detected to trigger this event", detectedTags); GUI.backgroundColor = TDS_EditorUtility.BoxDarkColor; GUILayout.Space(5); // Draws enter events EditorGUILayout.LabelField("Enter Events"); DrawEvents(events, ref foldouts); GUILayout.Space(5); // Draws exit events EditorGUILayout.LabelField("Exit Events"); DrawEvents(exitEvents, ref exitFoldouts); // Applies all modified properties on the SerializedObjects serializedObject.ApplyModifiedProperties(); EditorGUILayout.EndVertical(); GUI.backgroundColor = _originalColor; GUI.color = _originalGUIColor; }
protected override void DrawSettings() { base.DrawSettings(); EditorGUILayout.LabelField("Evolve", TDS_EditorUtility.HeaderStyle); TDS_EditorUtility.RadioToggle("Has Evolved", "Is the minion evolved", hasEvolved); GUILayout.Space(5); EditorGUILayout.LabelField("Rage", TDS_EditorUtility.HeaderStyle); TDS_EditorUtility.FloatField("Reset Rage Delay", "Delay to reset the rage", resetRageDelay); TDS_EditorUtility.IntSlider("Reset Rage Threshold", "Count of attacks to ignore the next damages", ragingThreshold, 1, 5); }
/// <summary> /// Draws the custom editor for the debugs of this class. /// </summary> private void DrawDebugs() { GUILayout.Space(5); TDS_EditorUtility.RadioToggle("Drunk", "Indicates if the Fire Eater is drunk", isDrunk); GUILayout.Space(5); if (isDrunk.boolValue) { TDS_EditorUtility.ProgressBar(25, soberUpTimer.floatValue / soberUpTime.floatValue, "Drunk"); GUILayout.Space(5); } }
/// <summary> /// Draws the editor of the editing scripts. /// </summary> public virtual void DrawEditor() { // Make a space at the beginning of the editor GUILayout.Space(10); Color _originalColor = GUI.backgroundColor; Color _originalGUIColor = GUI.color; GUI.backgroundColor = TDS_EditorUtility.BoxDarkColor; EditorGUILayout.BeginVertical("HelpBox"); // Records any changements on the editing objects to allow undo Undo.RecordObjects(targets, "Event System settings"); // Updates the SerializedProperties to get the latest values serializedObject.Update(); GUILayout.Space(3); TDS_EditorUtility.RadioToggle("Activated", "Is this event system activated or not", isActivated); if (isActivated.boolValue) { GUILayout.Space(3); EditorGUILayout.LabelField(new GUIContent("Current Event", "Current event processing"), new GUIContent(currentEvent.FindPropertyRelative("Name").stringValue)); } GUILayout.Space(5); TDS_EditorUtility.Toggle("Local", "Is this event system local-based or online ?", isLocal); GUILayout.Space(2); TDS_EditorUtility.Toggle("Des. Collider on Activation", "Should this object collider be desactivated when starting events", doDesTriggerOnActiv); TDS_EditorUtility.Toggle("Looping", "Should this event system loop when reaching the end or not", doLoop); TDS_EditorUtility.Toggle("Des. Object when Finished", "Should this object be deactivated when the event system gets finished", doDesObjectOnFinish); GUILayout.Space(2); TDS_EditorUtility.PropertyField("Activation mode", "Activation mode used to trigger these events", activationMode); if (activationMode.enumValueIndex < 3) { GUILayout.Space(3); GUI.backgroundColor = _originalColor; TDS_EditorUtility.PropertyField("Detected Tags", "Tags detected to trigger this event", detectedTags); GUI.backgroundColor = TDS_EditorUtility.BoxDarkColor; } GUILayout.Space(5); // Draws events DrawEvents(events, ref foldouts); // Applies all modified properties on the SerializedObjects serializedObject.ApplyModifiedProperties(); EditorGUILayout.EndVertical(); GUI.backgroundColor = _originalColor; GUI.color = _originalGUIColor; }
/// <summary> /// Draws the editor for the Character class debug elements. /// </summary> private void DrawDebugs() { GUILayout.Space(3); TDS_EditorUtility.RadioToggle("Attacking", "Is this character currently attacking or not", isAttacking); }
/// <summary> /// Draws the custom editor of the editing TDS_Camera objects. /// </summary> public void DrawEditor() { // Records any changements on the editing objects to allow undo Undo.RecordObjects(targets, "Camera script(s) settings"); // Updates the SerializedProperties to get the latest values serializedObject.Update(); TDS_EditorUtility.ObjectField("Camera", "Camera component attached to this script", camera, typeof(Camera)); GUILayout.Space(1); if (TDS_EditorUtility.ObjectField("Target", "Target this camera has to follow", cTarget, typeof(Transform))) { cameras.ForEach(c => c.Target = (Transform)cTarget.objectReferenceValue); } GUILayout.Space(3); TDS_EditorUtility.ObjectField("Top Bound", "Top bound collider of this level", topBound, typeof(BoxCollider)); TDS_EditorUtility.ObjectField("Left Bound", "Left bound collider of this level", leftBound, typeof(BoxCollider)); TDS_EditorUtility.ObjectField("Right Bound", "Right bound collider of this level", rightBound, typeof(BoxCollider)); TDS_EditorUtility.ObjectField("Bottom Bound", "Bottom bound collider of this level", bottomBound, typeof(BoxCollider)); GUILayout.Space(3); TDS_EditorUtility.PropertyField("Current Bounds", "Current bounds of the camera", currentBounds); GUILayout.Space(3); TDS_EditorUtility.PropertyField("Level Bounds", "Global bounds of the camera in the Level", levelBounds); TDS_EditorUtility.Vector3Field("Offset", "Offset of the camera from its target", offset); GUILayout.Space(1); if (TDS_EditorUtility.FloatSlider("Rotation", "Rotation in X axis of the camera", rotation, 0, 90)) { cameras.ForEach(c => c.Rotation = rotation.floatValue); } GUILayout.Space(2); if (EditorApplication.isPlaying && !serializedObject.isEditingMultipleObjects) { TDS_EditorUtility.ProgressBar(20, speedCurrent.floatValue / speedMax.floatValue, "Speed"); } if (TDS_EditorUtility.FloatSlider("Initial Speed", "Initial speed of the camera when starting moving", speedInitial, 0, speedMax.floatValue)) { cameras.ForEach(c => c.SpeedInitial = speedInitial.floatValue); } if (TDS_EditorUtility.FloatField("Max Speed", "Maximum value of this camera speed", speedMax)) { cameras.ForEach(c => c.SpeedMax = speedMax.floatValue); } if (TDS_EditorUtility.FloatField("Speed Coef", "Coefficient used to multiply the speed of the camera", speedCoef)) { cameras.ForEach(c => c.SpeedCoef = speedCoef.floatValue); } if (TDS_EditorUtility.FloatField("Speed Accl. Time", "Time the speed of the camera take from its initial value to reach its maximum value", speedAccelerationTime)) { cameras.ForEach(c => c.SpeedAccelerationTime = speedAccelerationTime.floatValue); } TDS_EditorUtility.FloatField("Viewport Y Max Bound Value", "This would be too complicated to describe here...", ViewportYMaxBoundValue); GUILayout.Space(5); TDS_EditorUtility.RadioToggle("Moving", "Is the camera currently moving", isMoving); // Apply modifications serializedObject.ApplyModifiedProperties(); }
/// <summary> /// Draws the debugs editor of the TDS_Juggler editing objects. /// </summary> private void DrawDebugs() { TDS_EditorUtility.RadioToggle("Aiming", "Is the Juggler currently aiming for a throw or not", isAiming); TDS_EditorUtility.RadioToggle("Can Shoot", "Can the Juggler actually shoot an object at something ?", canShoot); }