void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Toggle Pause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Rewind")) { Debug.Log("<color=#ff0000>REWIND</color>"); DOTween.RewindAll(); } if (GUILayout.Button("Restart")) { Debug.Log("<color=#ff0000>RESTART</color>"); DOTween.RestartAll(); } if (GUILayout.Button("Flip")) { DOTween.FlipAll(); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
void OnGUI() { if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Restart")) { DOTween.RestartAll(); } if (GUILayout.Button("Complete")) { DOTween.CompleteAll(); } if (GUILayout.Button("Rewind")) { DOTween.RewindAll(); } if (GUILayout.Button("Flip")) { DOTween.FlipAll(); } if (GUILayout.Button("Kill And Complete")) { DOTween.KillAll(true); } }
public override void OnEnter() { int numberOfTweensToggled = DOTween.TogglePauseAll(); if (debugThis.Value) { State.Debug("DOTween Control Methods TogglePause All - Toggled " + numberOfTweensToggled + " tweens"); } Finish(); }
public override void OnEnter() { int numberOfTweensToggled = DOTween.TogglePauseAll(); if (debugThis.Value) { Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "] State [" + State.Name + "] - DOTween Control Methods TogglePause All - SUCCESS! - Toggled " + numberOfTweensToggled + " tweens"); } Finish(); }
void Update() { if (Input.GetKeyDown(KeyCode.P)) { DOTween.TogglePauseAll(); } else if (Input.GetKeyDown(KeyCode.KeypadMinus)) { durationToApply -= 0.25f; if (durationToApply < 0.25f) { durationToApply = 0.25f; } SetGUITexts(); } else if (Input.GetKeyDown(KeyCode.KeypadPlus)) { durationToApply += 0.25f; SetGUITexts(); } if (followMode == FollowMode.Continuous || Input.GetMouseButtonDown(0)) { // Find mouse position to set as tween's new endValue Vector3 clickPos = Input.mousePosition; if (clickPos == prevMousePos) { return; } prevMousePos = clickPos; clickPos.z = -Camera.main.transform.position.z; clickPos = Camera.main.ScreenToWorldPoint(clickPos); // Change end value - snapStartValue tweens[0].ChangeEndValue(clickPos, durationToApply, true); // Change end value - NO snapStartValue tweens[1].ChangeEndValue(clickPos, durationToApply); // Change start value originalPos[2] = clickPos; tweens[2].ChangeStartValue(clickPos, durationToApply); // Change start and end value Vector3 newStartValue = new Vector3(UnityEngine.Random.Range(-10f, 10f), UnityEngine.Random.Range(-10f, 10f), 0); originalPos[3] = newStartValue; tweens[3].ChangeValues(newStartValue, clickPos, durationToApply); } }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Restart")) { DOTween.RestartAll(); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
void OnGUI() { GUILayout.BeginArea(new Rect(10, 10, Screen.width - 20, Screen.height - 20)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.Space(100); if (GUILayout.Button("Toggle Pause")) { DOTween.TogglePauseAll(); } GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
/// <summary> /// On register mediator /// </summary> public override void OnRegister() { PlayGameSignal.AddListener(() => { foreach (Transform item in View.transform) { item.gameObject.SetActive(true); } BallsStateService.HasPaused = false; DOTween.TogglePauseAll(); }); PauseGameSignal.AddListener(() => { BallsStateService.HasPaused = true; DOTween.TogglePauseAll(); foreach (Transform item in View.transform) { item.gameObject.SetActive(false); } }); StartGameSignal.AddListener(() => { BallsStateService.SpawnCount = View.SpawnCount; for (var i = 0; i < View.SpawnCount; i++) { View.SpawnBall(); } }); SpawnBallsSignal.AddListener(() => { BallsStateService.CurrentStageBallsCount = 0; for (var i = 0; i < View.SpawnCount; i++) { View.SpawnBall(); } }); }
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() { GUILayout.BeginArea(new Rect(10, 10, Screen.width - 20, Screen.height - 20)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.Label("Position Tweens"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Spawn 1")) { SpawnPosition(1); } if (GUILayout.Button("Spawn 10")) { SpawnPosition(10); } if (GUILayout.Button("Spawn 100")) { SpawnPosition(100); } if (GUILayout.Button("Spawn 300")) { SpawnPosition(300); } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("PositionX Tweens"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Spawn 1")) { SpawnPositionX(1); } if (GUILayout.Button("Spawn 10")) { SpawnPositionX(10); } if (GUILayout.Button("Spawn 100")) { SpawnPositionX(100); } if (GUILayout.Button("Spawn 300")) { SpawnPositionX(300); } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("PositionX Tweens with snapping"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Spawn 1")) { SpawnPositionX(1, true); } if (GUILayout.Button("Spawn 10")) { SpawnPositionX(10, true); } if (GUILayout.Button("Spawn 100")) { SpawnPositionX(100, true); } if (GUILayout.Button("Spawn 300")) { SpawnPositionX(300, true); } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("PositionY Tweens"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Spawn 1")) { SpawnPositionY(1); } if (GUILayout.Button("Spawn 10")) { SpawnPositionY(10); } if (GUILayout.Button("Spawn 100")) { SpawnPositionY(100); } if (GUILayout.Button("Spawn 300")) { SpawnPositionY(300); } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("Rotation Tweens"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Spawn 1")) { SpawnRotation(1); } if (GUILayout.Button("Spawn 10")) { SpawnRotation(10); } if (GUILayout.Button("Spawn 100")) { SpawnRotation(100); } if (GUILayout.Button("Spawn 300")) { SpawnRotation(300); } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.Label("Emit Particles Tweens"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Spawn 1")) { SpawnParticles(1); } if (GUILayout.Button("Spawn 10")) { SpawnParticles(10); } if (GUILayout.Button("Spawn 100")) { SpawnParticles(100); } if (GUILayout.Button("Spawn 300")) { SpawnParticles(300); } if (GUILayout.Button("Spawn 1000")) { SpawnParticles(1000); } GUILayout.EndHorizontal(); GUILayout.Space(5); GUILayout.BeginHorizontal(); if (GUILayout.Button("Toggle Pause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Kill")) { DOTween.KillAll(); } if (GUILayout.Button("Clear")) { Clear(); } if (GUILayout.Button("Clear FULL")) { Clear(true); } GUILayout.EndHorizontal(); recycle = GUILayout.Toggle(recycle, "Recycle"); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
void OnGUI() { if (GUILayout.Button("Rich Text Support: " + (richTextEnabled ? "ON" : "OFF"))) { richTextEnabled = !richTextEnabled; } GUILayout.BeginHorizontal(); if (GUILayout.Button("Color To Green")) { foreach (TextMeshPro t in texts) { t.DOColor(Color.green, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOColor(Color.green, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Color To Red")) { foreach (TextMeshPro t in texts) { t.DOColor(Color.red, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOColor(Color.red, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Fade Out")) { foreach (TextMeshPro t in texts) { t.DOFade(0, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFade(0, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Fade In")) { foreach (TextMeshPro t in texts) { t.DOFade(1, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFade(1, 1).SetEase(Ease.Linear); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Face Color To Green")) { foreach (TextMeshPro t in texts) { t.DOFaceColor(Color.green, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFaceColor(Color.green, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Face Color To Red")) { foreach (TextMeshPro t in texts) { t.DOFaceColor(Color.red, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFaceColor(Color.red, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Face Fade Out")) { foreach (TextMeshPro t in texts) { t.DOFaceFade(0, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFaceFade(0, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Face Fade In")) { foreach (TextMeshPro t in texts) { t.DOFaceFade(1, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFaceFade(1, 1).SetEase(Ease.Linear); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Glow Color To Green")) { foreach (TextMeshPro t in texts) { t.DOGlowColor(Color.green, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOGlowColor(Color.green, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Glow Color To Red")) { foreach (TextMeshPro t in texts) { t.DOGlowColor(Color.red, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOGlowColor(Color.red, 1).SetEase(Ease.Linear); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Outline Color To Green")) { foreach (TextMeshPro t in texts) { t.DOOutlineColor(Color.green, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOOutlineColor(Color.green, 1).SetEase(Ease.Linear); } } if (GUILayout.Button("Outline Color To Red")) { foreach (TextMeshPro t in texts) { t.DOOutlineColor(Color.red, 1).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOOutlineColor(Color.red, 1).SetEase(Ease.Linear); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Font Resize Down")) { foreach (TextMeshPro t in texts) { t.DOFontSize(10, 1); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFontSize(10, 1); } } if (GUILayout.Button("Font Resize Up")) { foreach (TextMeshPro t in texts) { t.DOFontSize(32, 1); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOFontSize(32, 1); } } if (GUILayout.Button("Scale to 1.5")) { foreach (TextMeshPro t in texts) { t.DOScale(1.5f, 1); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOScale(1.5f, 1); } } if (GUILayout.Button("Trim Max Visible Characters")) { foreach (TextMeshPro t in texts) { t.DOMaxVisibleCharacters(22, 1); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOMaxVisibleCharacters(22, 1); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Text Reset")) { DOTween.KillAll(); for (int i = 0; i < texts.Length; ++i) { texts[i].text = orTexts[i]; } for (int i = 0; i < uguiTexts.Length; ++i) { uguiTexts[i].text = orGuiTexts[i]; } } if (GUILayout.Button("Text Replace")) { foreach (TextMeshPro t in texts) { t.DOText(replaceWText, 5, richTextEnabled).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOText(replaceWText, 5, richTextEnabled).SetEase(Ease.Linear); } } if (GUILayout.Button("Text Replace Add")) { foreach (TextMeshPro t in texts) { t.DOText(" " + replaceWText, 5, richTextEnabled).SetRelative().SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOText(" " + replaceWText, 5, richTextEnabled).SetRelative().SetEase(Ease.Linear); } } if (GUILayout.Button("Text Replace W Scramble")) { foreach (TextMeshPro t in texts) { t.DOText(replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOText(replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetEase(Ease.Linear); } } if (GUILayout.Button("Text Replace Add W Scramble")) { foreach (TextMeshPro t in texts) { t.DOText(" " + replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetRelative().SetEase(Ease.Linear); } foreach (TextMeshProUGUI t in uguiTexts) { t.DOText(" " + replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetRelative().SetEase(Ease.Linear); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePauseAll(); } if (GUILayout.Button("Flip")) { DOTween.FlipAll(); } GUILayout.EndHorizontal(); }
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(); }