protected override void DerivedInspector(MotionEditor editor) { ShowVelocities = EditorGUILayout.Toggle("Show Velocities", ShowVelocities); ShowCycle = EditorGUILayout.Toggle("Show Cycle", ShowCycle); SetMaximumVelocity(EditorGUILayout.FloatField("Maximum Velocity", MaximumVelocity)); SetVelocityThreshold(EditorGUILayout.FloatField("Velocity Threshold", VelocityThreshold)); string[] names = new string[1 + Data.Source.Bones.Length]; names[0] = "Select..."; for (int i = 0; i < names.Length - 1; i++) { names[i + 1] = Data.Source.Bones[i].Name; } int index = EditorGUILayout.Popup("Phase Detector", 0, names); if (index > 0) { ToggleVariable(index - 1); } for (int i = 0; i < Data.Source.Bones.Length; i++) { if (Variables[i]) { using (new EditorGUILayout.VerticalScope("Box")) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(Data.Source.Bones[i].Name); EditorGUILayout.LabelField(Data.Source.Bones[Data.Symmetry[i]].Name); EditorGUILayout.EndHorizontal(); } } } Utility.SetGUIColor(UltiDraw.Grey); using (new EditorGUILayout.VerticalScope("Box")) { Utility.ResetGUIColor(); if (Optimising) { if (Utility.GUIButton("Stop Optimisation", UltiDraw.LightGrey, UltiDraw.Black)) { EditorCoroutines.StopCoroutine(RegularPhaseFunction.Optimise(), this); EditorCoroutines.StopCoroutine(InversePhaseFunction.Optimise(), this); Optimising = false; } } else { if (Utility.GUIButton("Start Optimisation", UltiDraw.DarkGrey, UltiDraw.White)) { EditorCoroutines.StartCoroutine(RegularPhaseFunction.Optimise(), this); EditorCoroutines.StartCoroutine(InversePhaseFunction.Optimise(), this); Optimising = true; } } if (Utility.GUIButton("Clear", UltiDraw.DarkGrey, UltiDraw.White)) { RegularPhaseFunction.Clear(); InversePhaseFunction.Clear(); } } RegularPhaseFunction.Inspector(editor); InversePhaseFunction.Inspector(editor); }
public void StopAnimation() { if (!Playing) { return; } Playing = false; EditorCoroutines.StopCoroutine(Play(), this); }
public static void StopCoroutine(this EditorWindow thisRef, string methodName) { EditorCoroutines.StopCoroutine(methodName, thisRef); }
public static void StopCoroutine(this EditorWindow thisRef, IEnumerator coroutine) { EditorCoroutines.StopCoroutine(coroutine, thisRef); }