/// <summary> /// pause the tweener /// </summary> public void Pause() { if (_tweener != null) { HOTween.Pause(_tweener); } }
//pauses the current tween and tries to play the idle animation public void Pause() { //block further tween execution in NextWaypoint() waiting = true; //pause the tweener of this object and play idle animation HOTween.Pause(transform); PlayIdle(); }
public override void OnExit() { if (onExit == OnExitAction.Nothing) { return; } if (onExit == OnExitAction.RewindOnExit) { HOTween.Rewind(tweenID.Value); } else if (onExit == OnExitAction.PauseOnExit) { HOTween.Pause(tweenID.Value); } }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Play")) { HOTween.Play(); } if (GUILayout.Button("Pause")) { HOTween.Pause(); } if (GUILayout.Button("Kill")) { HOTween.Kill(); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
IEnumerator ShowMenu() { isPaused = true; HOTween.Pause(); audio.Pause(); TweenParms parms = new TweenParms().Prop("position", new Vector3(_PausedBackground.transform.position.x, 0.5f, -5)).Ease(EaseType.EaseOutQuart); HOTween.To(_PausedBackground.transform, 0.05f, parms).WaitForCompletion(); parms = new TweenParms().Prop("position", new Vector3(_PlayButton.transform.position.x, 0.5f, -6)).Ease(EaseType.EaseOutQuart); HOTween.To(_PlayButton.transform, 0.07f, parms).WaitForCompletion(); parms = new TweenParms().Prop("position", new Vector3(_ReloadButton.transform.position.x, 0.5f, -6)).Ease(EaseType.EaseOutQuart); HOTween.To(_ReloadButton.transform, 0.09f, parms).WaitForCompletion(); parms = new TweenParms().Prop("position", new Vector3(_MenuButton.transform.position.x, 0.5f, -6)).Ease(EaseType.EaseOutQuart); yield return(StartCoroutine(HOTween.To(_MenuButton.transform, 0.1f, parms).WaitForCompletion())); Time.timeScale = 0; }
// =================================================================================== // UNITY METHODS --------------------------------------------------------------------- override public void OnInspectorGUI() { HOGUIStyle.InitGUI(); EditorGUIUtility.LookLikeControls(_labelsWidth, _fieldsWidth); GUILayout.Space(4); #if MICRO GUILayout.Label("HOTweenMicro v" + HOTween.VERSION); #else GUILayout.Label("HOTween v" + HOTween.VERSION); #endif GUILayout.Space(4); TweenInfo[] twInfos = HOTween.GetTweenInfos(); if (twInfos == null) { GUILayout.Label("No tweens"); return; } // Store and display tot running/paused/disabled tweens. int totTweens = twInfos.Length; List <TweenInfo> runningTweens = new List <TweenInfo>(); List <TweenInfo> pausedTweens = new List <TweenInfo>(); List <TweenInfo> completedTweens = new List <TweenInfo>(); List <TweenInfo> disabledTweens = new List <TweenInfo>(); foreach (TweenInfo twInfo in twInfos) { if (!twInfo.isEnabled) { disabledTweens.Add(twInfo); } else if (twInfo.isComplete) { completedTweens.Add(twInfo); } else if (twInfo.isPaused) { pausedTweens.Add(twInfo); } else { runningTweens.Add(twInfo); } } GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Tweens (tot - running/paused/completed/disabled):\n" + totTweens + " - " + runningTweens.Count + "/" + "/" + pausedTweens.Count + "/" + completedTweens.Count + "/" + disabledTweens.Count); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); // Draw play/pause/kill all buttons GUILayout.Space(4); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Play All", HOGUIStyle.BtTinyStyle, GUILayout.Width(76))) { HOTween.Play(); } if (GUILayout.Button("Pause All", HOGUIStyle.BtTinyStyle, GUILayout.Width(76))) { HOTween.Pause(); } if (GUILayout.Button("Complete All", HOGUIStyle.BtTinyStyle, GUILayout.Width(86))) { HOTween.Complete(); } if (GUILayout.Button("Kill All", HOGUIStyle.BtTinyStyle, GUILayout.Width(76))) { HOTween.Kill(); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); // Display data for each tween (divided by running/paused/completed/disabled) for (int i = 0; i < 4; ++i) { TweenGroup twGroup; List <TweenInfo> targetInfos; string groupLabel; switch (i) { case 0: twGroup = TweenGroup.Running; targetInfos = runningTweens; groupLabel = "Running"; break; case 1: twGroup = TweenGroup.Paused; targetInfos = pausedTweens; groupLabel = "Paused"; break; case 2: twGroup = TweenGroup.Completed; targetInfos = completedTweens; groupLabel = "Completed but not killed"; break; default: twGroup = TweenGroup.Disabled; targetInfos = disabledTweens; groupLabel = "Disabled"; break; } if (targetInfos.Count == 0) { continue; } GUILayout.Space(8); GUILayout.BeginVertical(HOGUIStyle.BoxStyleRegular); GUILayout.BeginHorizontal(); GUILayout.Label(groupLabel + " Tweens (" + targetInfos.Count + ")", HOGUIStyle.TitleStyle, GUILayout.ExpandWidth(false)); GUILayout.FlexibleSpace(); GUILayout.Label("Click a target to select it"); GUILayout.EndHorizontal(); GUILayout.Space(6); foreach (TweenInfo twInfo in targetInfos) { GUILayout.BeginVertical(GUI.skin.box); if (twInfo.isSequence) { GUILayout.BeginHorizontal(); GUILayout.Label("[Sequence]", HOGUIStyle.LabelSmallStyle); if (twGroup != TweenGroup.Disabled) { DrawTargetButtons(twInfo, twGroup); } GUILayout.EndHorizontal(); DrawInfo(twInfo); foreach (object twTarget in twInfo.targets) { DrawTarget(twInfo, twTarget, twGroup, true); } } else { DrawTarget(twInfo, twInfo.targets[0], twGroup, false); } GUILayout.EndVertical(); } GUILayout.EndVertical(); } }
void OnDisable() { //Debug.LogError("False"); HOTween.Pause(gameObject); }
public override void OnEnter() { HOTween.Pause(tweenID.Value); Finish(); }