static void GUIScrubber(float duration, Tween controller) { if (controller == null) { float prevSliderPos = sliderPos; sliderPos = GUILayout.HorizontalSlider(sliderPos, 0.0f, duration); if (!Mathf.Approximately(sliderPos, prevSliderPos)) { DOTween.GotoAll(sliderPos); } } else { // Get slider ID to be used to check mouseDown behaviour int sliderId = GUIUtility.GetControlID(FocusType.Passive) + 1; DOTween.GotoAll(GUILayout.HorizontalSlider(controller.Elapsed(false), 0.0f, controller.Duration(false)), controller.IsPlaying()); // Check mouse down on slider, and pause tweens accordingly. if (sliderId != 0 && Event.current.type == EventType.used) { if (GUIUtility.hotControl == sliderId) { DOTween.PauseAll(); } } // DOTween.Goto(GUILayout.HorizontalSlider(controller.Elapsed(false), 0.0f, controller.Duration(false)), controller.IsPlaying()); } }
public override void OnEnter() { int numberOfTweensInvolved = DOTween.GotoAll(to.Value, andPlay.Value); if (debugThis.Value) { State.Debug("DOTween Control Methods Go To All - " + numberOfTweensInvolved + " tweens involved"); } Finish(); }
public override void OnEnter() { int numberOfTweensInvolved = DOTween.GotoAll(to.Value, andPlay.Value); if (debugThis.Value) { Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "] State [" + State.Name + "] - DOTween Control Methods Go To All - SUCCESS! - " + numberOfTweensInvolved + " tweens involved"); } Finish(); }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.Label("Is backwards: " + pathTweens[0].isBackwards); GUILayout.BeginHorizontal(); if (GUILayout.Button("Play")) { DOTween.PlayAll(); } if (GUILayout.Button("Flip")) { DOTween.FlipAll(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Goto duration x 2")) { DOTween.GotoAll(duration * 2); } if (GUILayout.Button("Goto duration x 0.5")) { DOTween.GotoAll(duration * 0.5f); } if (GUILayout.Button("Goto WP 0")) { pathTweens[0].GotoWaypoint(0); } if (GUILayout.Button("Goto WP 2")) { pathTweens[0].GotoWaypoint(2); } if (GUILayout.Button("Goto WP 15")) { pathTweens[0].GotoWaypoint(15); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Complete")) { DOTween.CompleteAll(); } if (GUILayout.Button("Restart")) { DOTween.RestartAll(); } if (GUILayout.Button("Rewind")) { DOTween.RewindAll(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Goto 1")) { DOTween.GotoAll(1); } if (GUILayout.Button("Goto 2")) { DOTween.GotoAll(2); } if (GUILayout.Button("Goto 3")) { DOTween.GotoAll(3); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
void OnGUI() { DGUtils.BeginGUI(); DGUtils.GUIScrubber(controller); GUILayout.BeginHorizontal(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Goto 1.5")) { DOTween.GotoAll(1.5f); } if (GUILayout.Button("Kill")) { DOTween.KillAll(); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Play All")) { Debug.Log("Played tweens: " + DOTween.PlayAll()); } if (GUILayout.Button("Pause All")) { Debug.Log("Paused tweens: " + DOTween.PauseAll()); } if (GUILayout.Button("Kill All")) { Debug.Log("Killed tweens: " + DOTween.KillAll()); } if (GUILayout.Button("Complete+Kill All")) { Debug.Log("Killed tweens: " + DOTween.KillAll(true)); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Rewind All")) { Debug.Log("Rewinded tweens: " + DOTween.RewindAll()); } if (GUILayout.Button("Restart All")) { Debug.Log("Restarted tweens: " + DOTween.RestartAll()); } if (GUILayout.Button("Complete All")) { Debug.Log("Completed tweens: " + DOTween.CompleteAll()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("PlayForward All")) { Debug.Log("PlayForwarded tweens: " + DOTween.PlayForwardAll()); } if (GUILayout.Button("PlayBackwards All")) { Debug.Log("PlayBackwarded tweens: " + DOTween.PlayBackwardsAll()); } if (GUILayout.Button("Flip All")) { Debug.Log("Flipped tweens: " + DOTween.FlipAll()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Goto 1.5 All")) { Debug.Log("Goto-ed tweens: " + DOTween.GotoAll(1.5f)); } if (GUILayout.Button("Goto 3 All")) { Debug.Log("Goto-ed tweens: " + DOTween.GotoAll(3)); } if (GUILayout.Button("Goto 4.5 All")) { Debug.Log("Goto-ed tweens: " + DOTween.GotoAll(4.5f)); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Play by Id")) { Debug.Log("Played tweens: " + DOTween.Play(intId)); } if (GUILayout.Button("Play by StringId")) { Debug.Log("Played tweens: " + DOTween.Play(stringId)); } if (GUILayout.Button("Play by UnityObjectId")) { Debug.Log("Played tweens: " + DOTween.Play(this)); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Pause by Id")) { Debug.Log("Paused tweens: " + DOTween.Pause(intId)); } if (GUILayout.Button("Pause by StringId")) { Debug.Log("Paused tweens: " + DOTween.Pause(stringId)); } if (GUILayout.Button("Pause by UnityObjectId")) { Debug.Log("PlaPausedyed tweens: " + DOTween.Pause(this)); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Kill by Id")) { Debug.Log("Killed tweens: " + DOTween.Kill(intId)); } if (GUILayout.Button("Complete+Kill by Id")) { Debug.Log("Killed tweens: " + DOTween.Kill(intId, true)); } if (GUILayout.Button("Kill by StringId")) { Debug.Log("Killed tweens: " + DOTween.Kill(stringId)); } if (GUILayout.Button("Kill by UnityObjectId")) { Debug.Log("Killed tweens: " + DOTween.Kill(this)); } if (GUILayout.Button("Clear")) { Debug.Log(":::::::::::: CLEAR"); DOTween.Clear(); } if (GUILayout.Button("Clear & Reload")) { Debug.Log(":::::::::::: CLEAR AND RELOAD"); int level = SceneManager.GetActiveScene().buildIndex; DOTween.Clear(); SceneManager.LoadScene(level); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); foreach (Tween t in tweens) { if (GUILayout.Button("Direct Kill")) { t.Kill(); } } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("Global DOTween Timescale"); GUILayout.BeginHorizontal(); DOTween.timeScale = GUILayout.HorizontalSlider(DOTween.timeScale, 0.0f, 20.0f); if (GUILayout.Button("Reset", GUILayout.Width(80))) { DOTween.timeScale = 1; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); for (int i = 0; i < tweens.Length; ++i) { GUILayout.Label("Single Timescale"); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); foreach (Tween t in tweens) { t.timeScale = GUILayout.HorizontalSlider(t.timeScale, 0.0f, 20.0f, GUILayout.Width(60)); if (GUILayout.Button("Reset", GUILayout.Width(80))) { t.timeScale = 1; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); foreach (Tween t in tweens) { GUILayout.Label("Elapsed: " + t.Elapsed(false) + "\nFullElapsed: " + t.Elapsed() + "\nElapsed %: " + t.ElapsedPercentage(false) + "\nFullElapsed %: " + t.ElapsedPercentage() + "\nCompleted Loops: " + t.CompletedLoops() ); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
void OnGUI() { DGUtils.BeginGUI(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } GUILayout.BeginHorizontal(); if (GUILayout.Button("Rewind")) { DOTween.RewindAll(); } if (GUILayout.Button("Restart")) { DOTween.RestartAll(); } if (GUILayout.Button("Complete")) { DOTween.CompleteAll(); } if (GUILayout.Button("Flip")) { DOTween.FlipAll(); } if (GUILayout.Button("Goto 0.5")) { DOTween.GotoAll(0.5f); } if (GUILayout.Button("Goto 1")) { DOTween.GotoAll(1); } if (GUILayout.Button("Goto 1.5")) { DOTween.GotoAll(1.5f); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Sequence > LoopType.Restart")) { NewSequence(LoopType.Restart, false); } if (GUILayout.Button("Sequence > LoopType.Restart > Flipped")) { NewSequence(LoopType.Restart, true); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Sequence > LoopType.Yoyo")) { NewSequence(LoopType.Yoyo, false); } if (GUILayout.Button("Sequence > LoopType.Yoyo > Flipped")) { NewSequence(LoopType.Yoyo, true); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }