void DrawGroupControls() { var group_names = GetAllGroupNames(); if (group_names.Count > 0) { _groupsFoldout = EditorGUILayout.Foldout(_groupsFoldout, "Groups"); if (_groupsFoldout) { foreach (var group_name in group_names) { SwfEditorUtils.DoWithEnabledGUI(false, () => { EditorGUILayout.TextField("Name", group_name); }); { EditorGUI.BeginChangeCheck(); var new_rate_scale = EditorGUILayout.FloatField( "Rate Scale", _manager.GetGroupRateScale(group_name)); if (EditorGUI.EndChangeCheck()) { _manager.SetGroupRateScale(group_name, new_rate_scale); } } { EditorGUI.BeginChangeCheck(); var new_user_unscaled_dt = EditorGUILayout.Toggle( "Use Unscaled Dt", _manager.IsGroupUseUnscaledDt(group_name)); if (EditorGUI.EndChangeCheck()) { _manager.SetGroupUseUnscaledDt(group_name, new_user_unscaled_dt); } } SwfEditorUtils.DoRightHorizontalGUI(() => { if (_manager.IsGroupPaused(group_name) && GUILayout.Button("Resume")) { _manager.ResumeGroup(group_name); } if (_manager.IsGroupPlaying(group_name) && GUILayout.Button("Pause")) { _manager.PauseGroup(group_name); } }); } } } }
void DrawClipControls() { SwfEditorUtils.DoRightHorizontalGUI(() => { if (GUILayout.Button("Stop")) { AllControllersForeach(ctrl => ctrl.Stop(ctrl.isStopped)); } if (GUILayout.Button("Play")) { AllControllersForeach(ctrl => { var rewind = ctrl.isPlaying || (ctrl.clip && ( ctrl.clip.currentFrame == 0 || ctrl.clip.currentFrame == ctrl.clip.frameCount - 1)); ctrl.Play(rewind); }); } }); }
void DrawControls() { SwfEditorUtils.DoRightHorizontalGUI(() => { if (_manager.useUnscaledDt && GUILayout.Button("Use Scaled Dt")) { _manager.useUnscaledDt = false; } if (!_manager.useUnscaledDt && GUILayout.Button("Use Unscaled Dt")) { _manager.useUnscaledDt = true; } if (_manager.isPaused && GUILayout.Button("Resume")) { _manager.Resume(); } if (_manager.isPlaying && GUILayout.Button("Pause")) { _manager.Pause(); } }); }