void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Toggle Pause")) { DOTween.TogglePause(); } if (GUILayout.Button("Rewind")) { Debug.Log("<color=#ff0000>REWIND</color>"); DOTween.Rewind(); } if (GUILayout.Button("Restart")) { Debug.Log("<color=#ff0000>RESTART</color>"); DOTween.Restart(); } if (GUILayout.Button("Flip")) { DOTween.Flip(); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
public override void OnEnter() { int numberOfTweensRestarted = 0; switch (tweenIdType) { case DOTweenActionsEnums.TweenId.UseString: if (string.IsNullOrEmpty(stringAsId.Value) == false) { numberOfTweensRestarted = DOTween.Restart(stringAsId.Value, includeDelay.Value); } break; case DOTweenActionsEnums.TweenId.UseTag: if (string.IsNullOrEmpty(tagAsId.Value) == false) { numberOfTweensRestarted = DOTween.Restart(tagAsId.Value, includeDelay.Value); } break; case DOTweenActionsEnums.TweenId.UseGameObject: if (gameObjectAsId.Value != null) { numberOfTweensRestarted = DOTween.Restart(gameObjectAsId.Value, includeDelay.Value); } break; } if (debugThis.Value) { Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "] State [" + State.Name + "] - DOTween Control Methods Restart By Id - SUCCESS! - Restarted " + numberOfTweensRestarted + " tweens"); } Finish(); }
public override void OnNotificationReceived(Notification notification, NotificationParam param = null) { switch (notification) { case Notification.OpenPopUp: HideAllPopUps(); currentPopUp = GetCorrectPopUp((PopUpType)param.intData[0]); if (currentPopUp != null) { bgPanel.Show(); currentPopUp.Show(); DOTween.Restart(currentPopUp, "popUpShow"); } break; case Notification.ClosePopUp: if (currentPopUp != null) { currentPopUp.Hide(); currentPopUp.transform.localScale = Vector3.zero; } bgPanel.Hide(); break; } }
private bool DoTween(bool leave) { if (GetDone(DoFlag.Tween)) { return(false); } SetDone(DoFlag.Tween); if (cameraMode != null) { string id = leave ? cameraMode.tweenIdLeave : cameraMode.tweenIdEnter; if (!string.IsNullOrEmpty(id)) { int count = DOTween.Restart(id); if (count > 0) { var playings = DOTween.PlayingTweens(); float duration = GetMaxDuration(playings, id); if (duration == 0f) { return(false); } StartCoroutine(WaitTweenComplete(duration, leave)); return(true); } } } return(false); }
public void PlayOnIncorrect() { timeRemaining -= Time.deltaTime * 500; // 10 seconds DOTween.Restart(gameObject, "shake"); if (angerLevel >= 3) { timeRemaining = 0; CameraShake.Shake(0.5f, 0.5f); Leave(); } else if (angerLevel >= 2) { DOTween.Restart(gameObject, "anger3"); angerLevel++; } else if (angerLevel >= 1) { DOTween.Restart(gameObject, "anger2"); angerLevel++; } else if (angerLevel >= 0) { DOTween.Restart(gameObject, "anger1"); angerLevel++; } }
public override void OnEnter() { int numberOfTweensRestarted = 0; switch (tweenIdType) { case Doozy.PlayMaker.Actions.TweenId.UseString: if (string.IsNullOrEmpty(stringAsId.Value) == false) { numberOfTweensRestarted = DOTween.Restart(stringAsId.Value, includeDelay.Value); } break; case Doozy.PlayMaker.Actions.TweenId.UseTag: if (string.IsNullOrEmpty(tagAsId.Value) == false) { numberOfTweensRestarted = DOTween.Restart(tagAsId.Value, includeDelay.Value); } break; case Doozy.PlayMaker.Actions.TweenId.UseGameObject: if (gameObjectAsId.Value != null) { numberOfTweensRestarted = DOTween.Restart(gameObjectAsId.Value, includeDelay.Value); } break; } if (debugThis.Value) { State.Debug("DOTween Control Methods Restart By Id - Restarted " + numberOfTweensRestarted + " tweens"); } Finish(); }
public IEnumerator TutoStepThree(bool draw) { noInput = true; //Debug.Log("three"); if (draw) { DOTween.Restart("tuto_out"); } tutoStep = 3; SetState(GameState.Idle); if (draw) { StartCoroutine(CardManager.Instance.DrawCard()); } tutoTexts[0].SetActive(false); tutoTexts[1].SetActive(false); tutoTexts[3].SetActive(false); yield return(new WaitForSeconds(0.8f)); DOTween.Restart("tuto_03"); yield return(new WaitForSeconds(0.3f)); tutoTexts[2].SetActive(true); noInput = false; }
private void LetDoTweenHandleShowHide(GameObject element, string activeWord) { if (!element.activeSelf) { element.Show(); } DOTween.Restart(element, activeWord); }
public void TurnOff() { if (!turnedOn) { return; } turnedOn = false; DOTween.Restart("GuessExit"); }
public void Show(float maxTimerValue, bool isCountdown, List <Notification> notificationsOnTimerStart = null, List <Notification> notificationsOnTimerHidden = null) { SetUpInitialValues(maxTimerValue, isCountdown, notificationsOnTimerStart, notificationsOnTimerHidden); if (timerObject != null) { DOTween.Restart(timerObject, objectShowId); } else { OnTimerShown(); } }
public void Serve() { //scoring logic; ice.gameObject.SetActive(false); bool success = Orderer.Instance.checkAndScoreDrink(drink); if (success) { fx.GetComponent <ParticleSystem>().Play(); DOTween.Restart(gameObject, "shakeCup"); } drink = new Drink(); }
public IEnumerator QuitTuto() { //Debug.Log("Quit"); tutoStep = 5; tuto = false; tutoTexts[0].SetActive(false); tutoTexts[1].SetActive(false); tutoTexts[2].SetActive(false); tutoTexts[3].SetActive(false); DOTween.Restart("tuto_out"); yield return(new WaitForSeconds(1)); StartCoroutine(CardManager.Instance.PickCard(0, 2)); }
public void TurnOn(bool guessIsRight) { if (turnedOn) { return; } guessText.text = (guessIsRight) ? "Right guess !" : "Wrong guess !"; complementText.text = "Timelines :\n\n" + "1. " + CardsManager.m_Instance.getDateAtIndex(0) + "\n" + "2. " + CardsManager.m_Instance.getDateAtIndex(1) + "\n" + "3. " + CardsManager.m_Instance.getDateAtIndex(2); DOTween.Restart("GuessEnter"); turnedOn = true; }
public IEnumerator TutoStepFour() { noInput = true; //Debug.Log("four"); tutoStep = 4; SetState(GameState.Idle); tutoTexts[0].SetActive(false); tutoTexts[1].SetActive(false); tutoTexts[2].SetActive(false); DOTween.Restart("tuto_04"); yield return(new WaitForSeconds(0.5f)); tutoTexts[3].SetActive(true); noInput = false; }
public IEnumerator ScreenTransition(float speed, float inBetweenTime, bool menuState, bool thankyouState) { //yield return new WaitForSeconds(inBetweenTime*0.25f); float counter = 0; while (counter < 1) { counter += Time.deltaTime * speed; float t = Mathf.Sin(counter * Mathf.PI * 0.5f); screenTransition.maskValue = Mathf.Lerp(0, 1, t); yield return(new WaitForEndOfFrame()); } yield return(new WaitForSeconds(inBetweenTime)); menu.SetActive(menuState); thankYou.SetActive(thankyouState); float counter2 = 0; while (counter2 < 1) { counter2 += Time.deltaTime * speed; float t = Mathf.Sin(counter2 * Mathf.PI * 0.5f); screenTransition.maskValue = Mathf.Lerp(1, 0, t); yield return(new WaitForEndOfFrame()); } if (tuto) { noInput = true; yield return(new WaitForSeconds(0.01f)); DOTween.Restart("tuto_01"); yield return(new WaitForSeconds(1)); tutoTexts[0].SetActive(true); noInput = false; tutoStep = 1; } else { noInput = false; } }
void setPaired(int paired, bool instance = false) { txtMatches.SetText(string.Format("Paired: {0}", paired)); int id = txtMatches.GetInstanceID(); DOTween.Kill(id); DOTween.Restart(id); if (instance) { txtMatches.transform .DOScale(scaleValue, scaleTime) .SetEase(Ease.Linear) .SetLoops(2, LoopType.Yoyo) .SetId(id); } }
public IEnumerator TutoStepThreeHalf() { noInput = true; //Debug.Log("threeHalf"); tutoStep = 35; SetState(GameState.Casting); BoardManager.Instance.HighlightAdjacents(); tutoTexts[0].SetActive(false); tutoTexts[1].SetActive(false); tutoTexts[3].SetActive(false); tutoTexts[2].SetActive(false); DOTween.Restart("tuto_035"); yield return(new WaitForSeconds(0.1f)); noInput = false; }
private void HideTimer() { if (_runTimer) { _runTimer = false; } if (timerObject != null) { DOTween.Restart(timerObject, objectHideId); } else { OnTimerHidden(); } }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePause(); } if (GUILayout.Button("Restart")) { DOTween.Restart(); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
public IEnumerator BombAttack(int x, int y) { int start = Mathf.Clamp(Mathf.FloorToInt(maxWidth * 0.5f) - (currentZone + 1), 0, maxWidth); int max = start + (currentZone + 1) * 2; if (x + 1 < max) { if (items[x + 1, y] != null) { items[x + 1, y].HitItem(); DOTween.Restart("camera_shake_1"); } InstantiateFX(x + 1, y, CardManager.Instance.bombFX, 1.5f); } if (x - 1 >= start) { if (items[x - 1, y] != null) { items[x - 1, y].HitItem(); DOTween.Restart("camera_shake_1"); } InstantiateFX(x - 1, y, CardManager.Instance.bombFX, 1.5f); } if (y + 1 < max) { if (items[x, y + 1] != null) { items[x, y + 1].HitItem(); DOTween.Restart("camera_shake_1"); } InstantiateFX(x, y + 1, CardManager.Instance.bombFX, 1.5f); } if (y - 1 >= start) { if (items[x, y - 1] != null) { items[x, y - 1].HitItem(); DOTween.Restart("camera_shake_1"); } InstantiateFX(x, y - 1, CardManager.Instance.bombFX, 1.5f); } yield return(new WaitForEndOfFrame()); SoundManager.Instance.PlaySound(2, SoundManager.Instance.sfx_bomb); ComputeConnections(); }
public IEnumerator TutoStepTwo() { noInput = true; //Debug.Log("two"); tutoStep = 2; SetState(GameState.Casting); tutoTexts[0].SetActive(false); tutoTexts[2].SetActive(false); tutoTexts[3].SetActive(false); DOTween.Restart("tuto_02"); BoardManager.Instance.HighlightSpecificCell(4, 5); yield return(new WaitForSeconds(0.3f)); tutoTexts[1].SetActive(true); noInput = false; }
public void Scoring(int add, string tag) { switch (tag) { case "enemy": enemyScore += add; break; case "bonuses": bonusScore += add; break; } DOTween.Restart("ShakeScale"); DOTween.Kill("ShakeScale"); uiManager.score.transform.DOShakeScale(1, 1, 20, 90, true).SetEase(Ease.InQuad).SetId("ShakeScale"); uiManager.score.transform.DOShakePosition(1, Vector3.up * 10, 20, 0, false, true).SetEase(Ease.InQuad).SetId("ShakeScale"); uiManager.score.transform.DOShakeRotation(0.8f, 5, 20, 90, true).SetEase(Ease.InQuad).SetId("ShakeScale"); }
private void Update() { transform.position = Input.mousePosition; if (Input.GetMouseButtonDown(0)) { cursorImage.sprite = pressedCursorSprite; highlightTransform.position = transform.position; DOTween.Restart("cursor_highlight"); } if (Input.GetMouseButtonUp(0)) { cursorImage.sprite = defaultCursorSprite; } }
void Update() { // Fade out the compass when the camera orientation is at 'origin' // Note: MapCamera.TargetElevation is 89 degrees max if ((Mathf.Approximately(camera.TargetAzimuth, 0f) || Mathf.Approximately(camera.TargetAzimuth, 360f)) && Mathf.Approximately(camera.TargetElevation, 89f)) { if (compassImage.color.a == 1) { DOTween.PlayBackwards(compassImage.gameObject); } } else if (compassImage.color.a == 0) { DOTween.Restart(compassImage.gameObject); } // Orientate the compass to match MapCamera orientation compassTransform.rotation = Quaternion.Euler(compassTransform.transform.rotation.eulerAngles .SetX(90f - camera.RealElevation) .SetZ(camera.RealAzimuth)); }
void OnGUI() { DGUtils.BeginGUI(); GUILayout.BeginHorizontal(); if (GUILayout.Button("TogglePause")) { DOTween.TogglePause(); } if (GUILayout.Button("Complete")) { DOTween.Complete(); } if (GUILayout.Button("Restart")) { DOTween.Restart(); } if (GUILayout.Button("Rewind")) { DOTween.Rewind(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Goto 1")) { DOTween.Goto(1); } if (GUILayout.Button("Goto 2")) { DOTween.Goto(2); } if (GUILayout.Button("Goto 3")) { DOTween.Goto(3); } GUILayout.EndHorizontal(); DGUtils.EndGUI(); }
public void CollectCubeStack() { if (stackedCubes.Count >= 5) { Camera.main.DOFieldOfView(fovIndex, 0.3f); fovIndex += 2.3f; } Camera.main.DOShakeRotation(0.2F, 0.2f); transform.DOMoveY(_playerPlusPosIndex, 0.03f).SetEase(Ease.OutBack).OnComplete(() => { anim.SetTrigger(Jump); DOTween.Restart("PlayerTween"); _playerPlusPosIndex += 2; Vector3 stackPos = new Vector3(0, 1, 0); GameObject stackedCube = Instantiate(GameManager.Instance.cubeForStack, stackPos, Quaternion.identity); stackedCube.transform.parent = transform; var position = stackedCube.transform.position; GameObject starObj = Instantiate(starExplosion, new Vector3(position.x, position.y, position.z - 2f), Quaternion.identity); starObj.transform.parent = stackedCube.transform; stackedCube.transform.DOShakeScale(0.5f, 0.7f).SetId("CubeTween"); stackedCubes.Add(stackedCube); stackedCube.transform.localPosition = new Vector3(0, stackedCube.transform.localPosition.y, 0); foreach (GameObject gb in stackedCubes) { if (gb == stackedCubes[stackedCubes.Count - 1]) { lastCube = gb; } } }); }
/* * // Start is called before the first frame update * public void UpdatePullOutThing(Sprite next) * { * currentPullOutSprite = nextPullOutSprite; * nextPullOutSprite = next; * //DOTween.Play(nextPullOutSprite.gameObject); * DOTween.Restart(next_weapon); * } * * public void ChangeSprite() * { * Sprite tmpsp = currentPullOutSprite; * currentPullOutSprite = nextPullOutSprite; * nextPullOutSprite = tmpsp; * } */ public void Update_Sprite() { DOTween.Restart(nextPullOutSprite.gameObject); }
public void SwitchToMainMenu() { DOTween.Restart("MainMenuEnter"); }
public void BeginSwitchToMainMenu() { DOTween.Restart("GameExit"); }
private void OnTriggerEnter(Collider other) { if (!other.gameObject.CompareTag("MyBrick") && !other.gameObject.CompareTag("Player")) { return; } _camera.DOShakeRotation(0.2f, 0.7f); _myParent.GetComponent <DOTweenAnimation>().DOPlay(); DOTween.Play("SliderClose"); if (multiplier != "x20") { if (GameManager.Instance.myBricks.Count != 1) { var gObj = other.gameObject; gObj.transform.parent = null; GameManager.Instance.myBricks.Remove(gObj); GameManager.Instance.myBricks[GameManager.Instance.myBricks.Count - 1].GetComponent <BoxCollider>().enabled = true; GameManager.Instance.yPos -= 1; } } switch (multiplier) { case "x1": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 1; break; case "x2": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 2; break; case "x3": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 3; break; case "x4": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 4; break; case "x5": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 5; break; case "x6": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 6; break; case "x7": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 7; break; case "x8": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 8; break; case "x9": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 9; break; case "x10": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 10; break; case "x20": UIManager.Instance.multiplierText.text = multiplier; DOTween.Restart("Text"); GameManager.Instance.winMultiplier = 20; break; } }