private void Update() { if (GameObject.FindObjectsOfType <Enemy>().Length <= 0) { if (levelCompleteText) { levelCompleteText.SetActive(true); } if (progressBar) { LeanTween.pause(progressBar.gameObject); } if (Input.GetKeyDown(KeyCode.Space)) { LoadNextLevel(); } } else { Manager.Instance.CountTime(); } if (Input.GetKeyDown(KeyCode.R)) { RestartLevel(); } }
// Code that runs on entering the state. public override void OnEnter() { GameObject go = Fsm.GetOwnerDefaultTarget(gameObject); LeanTween.pause(go); Finish(); }
private void Start() { spriteRenderer = GetComponent <SpriteRenderer>(); pingPongAnimation = LeanTween.scale(gameObject, Vector2.one * scaleSize, scaleTime).setEaseInOutBack().setLoopPingPong().id; LeanTween.pause(pingPongAnimation); SetShieldAlphaTo(0f); }
//===================================================== #region IPauseListener public void OnPauseEvent(bool isPaused) { _isPaused = isPaused; if (_cameraPathAnimator != null) { // Manage active fly-thru switch (_isPaused) { case true: _cameraPathAnimator.Pause(); break; case false: _cameraPathAnimator.Play(); break; } return; } if (_isCameraFollowingPath == false) { return; } // Manage active tween if (_isPaused == true && _tweenId != -1) { LeanTween.pause(_tweenId); } else if (_isPaused == false && _tweenId != -1) { LeanTween.resume(_tweenId); } }
IEnumerator WarningState() { warningState = true; LeanTween.pause(tweenID); // Pysäytetään kameran rotaatio spriteRenderer.sprite = viewConeWarningSprite; cameraLight.color = warningColor; cameraLight.intensity = 0.8f; StartCoroutine(LerpViewConeSize(originalSize * warningConeMultiplier)); // Muutetaan viewconen kokoa suuremmaksi yield return(new WaitForSeconds(safetyTimer)); // Katsotaan onko tietyn ajan kuluessa Warning-tila päällä eli onko pelaaja näkökentässä //StopCoroutine("LerpViewConeSize"); if (warningState) { StartCoroutine(AlarmState()); // Laitetaan kamera seuraamaan pelaajaa } else if (!alarmState) { spriteRenderer.sprite = viewConeSafeSprite; cameraLight.color = safeColor; cameraLight.intensity = 0.5f; StartCoroutine(LerpViewConeSize(originalSize)); yield return(new WaitForSeconds(0.5f)); LeanTween.resume(tweenID); } yield return(null); }
IEnumerator Rotate(float angle, float rotationTime) { clockwise = !clockwise; if (tweenID != 0) { LeanTween.pause(tweenID); tweaningPaused = true; yield return(new WaitForSeconds(stopTimer)); tweaningPaused = false; LeanTween.resume(tweenID); } if (clockwise) { tweenID = LeanTween.rotateAroundLocal(gameObject, Vector3.forward, angle, rotationTime).id; } else { tweenID = LeanTween.rotateAroundLocal(gameObject, Vector3.back, angle, rotationTime).id; } yield return(null); }
private void FreezeScoop() { if (verticalScoopTween != null) { Debug.Log("Freezing scoop: " + flavor, gameObject); LeanTween.pause(verticalScoopTween.id); } }
private void FadeOutAndStopShield() { LeanTween.alpha(gameObject, 0, 1f).setOnComplete(() => { LeanTween.pause(pingPongAnimation); shieldIsOn = false; }); }
// public void Start(){ // LeanTween.alpha(tweenAlpha, 0f, 1f).setRecursive(false); // } //void Update () { // if (Time.time >= nextElapsed) // { // nextElapsed = Time.time + 0.1f; // GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); // float randRad = Random.Range(0f, 2f * Mathf.PI); // float radius = 4f; // var pos = new Vector3(Mathf.Cos(randRad ) * radius, Mathf.Sin(randRad) * radius, 0f); // LeanTween.move(cube, pos, 1f).setSpeed(1f).setDestroyOnComplete(true); // } // Time.timeScale = gameScale; //} void Start() { object tweenFinishedObj = "hi" as object; int tweenId = LeanTween.moveX(gameObject, 5f, 2.0f).setOnComplete(tweenFinished, tweenFinishedObj).id; LeanTween.pause(gameObject); Debug.Log("isPaused:" + LeanTween.isPaused(gameObject) + " id based pause:" + LeanTween.isPaused(tweenId)); }
public void OpenDisplay(GameObject player) { if (interactable) { EventSystemGame.current.PlaySound("Pop"); GetComponentInChildren <Canvas>().enabled = true; LeanTween.pause(gameObject); } }
public void StopTap() { if (tapping) { tapping = false; LeanTween.pause(gameObject); Fade(0, .3f); } }
public void Pause() { enabled = false; if (mLeanTweenActiveAnimID1 != -1) { LeanTween.pause(mLeanTweenActiveAnimID1); } }
void Update() { if(Input.GetMouseButtonDown(0)) { LeanTween.pause(card); LeanTween.rotateY(card, shakeAmount, shakeTime).setEase(tweenOption).setEaseShake().setLoopCount(5); SoundManager.GetInstance().Play(EFFECT_TYPE.SummonFail); } }
public void Pause() { // NOTE: LT breaks if you call it twice directly if (!isPauseCheck) { isPauseCheck = true; LeanTween.pause(gameObject); } }
private void Start() { LeanTween.init(); lt = LeanTween.move(base.gameObject, 100f * Vector3.one, 2f); id = lt.id; LeanTween.pause(id); ff = LeanTween.move(base.gameObject, Vector3.zero, 2f); fid = ff.id; LeanTween.pause(fid); }
protected override void _Pause() { if (petInstance) { petInstance.GetComponentInChildren <Animator>().enabled = false; } LeanTween.pause(inhalerButton); LeanTween.pause(dayBackground); LeanTween.pause(nightBackground); }
void CheckTargetUpdate(float f) { if (TargetItem.destroying || TargetItem == null || !TargetItem.gameObject.activeSelf) { StopCoroutine(FindTargetLoop()); LeanTween.pause(gameObject); TargetItem = null; StartCoroutine(FindTargetLoop()); } }
public void PauseAnimations() { for (int i = 0; i < texts.Length; ++i) { if (!texts[i].gameObject.activeInHierarchy) { continue; } LeanTween.pause(texts[i].gameObject); } }
public void ShowFlower() { transform.localScale = Vector3.zero; rotateId = LeanTween.rotateAround(gameObject, Vector3.forward, 360, 0.2f).setLoopClamp().id; LeanTween.scale(gameObject, new Vector3(size, size, size), rotateTime).setEaseInQuad().setOnComplete(() => { LeanTween.pause(rotateId); LeanTween.rotateZ(gameObject, 0, 0.5f).setEaseOutBack(); LeanTween.alpha(gameObject, 0, 1f).setDelay(timeBeforeDisappear); }); }
public override void Collected() { if (!isCollected) { isCollected = true; collectionSound.start(); EventSystem.current.PlayerEatFood(); LeanTween.pause(gameObject); LeanTween.scale(gameObject, new Vector3(0.1f, 0.1f, 1), 0.5f).setEaseInBounce().setOnComplete(Deactivate); } }
void AttackUnit() { LeanTween.pause(u1); var originalRotation = u1.transform.eulerAngles; u1.transform.LookAt(u2.transform); var rotateVal = u1.transform.eulerAngles; u1.transform.eulerAngles = originalRotation; LeanTween.rotateLocal(u1, rotateVal, 0.3f); }
void MoveTowardWaypoint() { LeanTween.pause(u1); var originalRotation = u1.transform.eulerAngles; u1.transform.LookAt(w.transform); var rotateVal = u1.transform.eulerAngles; u1.transform.eulerAngles = originalRotation; LeanTween.rotate(u1, rotateVal, 0.3f); }
void Update() { // work around for enemies who spawn during a state change they seem to miss the event call when this happens if(ShooterGameManager.Instance.IsPaused) { LeanTween.pause(this.gameObject); } else { LeanTween.resume(this.gameObject); } if(ShooterGameManager.Instance.isGameOver) { StartCoroutine(DestroyEnemy()); } }
/* * private void OnPhotonAuthenticationSuccess(GetPhotonAuthenticationTokenResult result) * { * Debug.Log("Login to Photon server successfull"); * * AuthenticationValues customAuth = new AuthenticationValues(); * customAuth.AuthType = CustomAuthenticationType.Custom; * customAuth.AddAuthParameter("username", ""); * customAuth.AddAuthParameter("token", result.PhotonCustomAuthenticationToken); * * Debug.Log(result.PhotonCustomAuthenticationToken); * PhotonNetwork.AuthValues = customAuth; * Debug.Log(PhotonNetwork.AuthValues.AuthGetParameters); * } * * private void OnPhotonAuthenticationFailure(PlayFabError error) * { * Debug.Log(3); * } */ private void ShowConnectingLayer() { LeanTween.pause(FindObjectOfType <Parallax>().foreground.gameObject); LeanTween.pause(FindObjectOfType <Parallax>().background.gameObject); if (menuManager.serverCover.gameObject.activeSelf) { menuManager.serverCover.EnableAnimations(); return; } menuManager.serverCover.gameObject.SetActive(true); }
void Start() { LeanTween.init(); lt = LeanTween.move(gameObject, 100 * Vector3.one, 2); id = lt.id; LeanTween.pause(id); ff = LeanTween.move(gameObject, Vector3.zero, 2); fid = ff.id; LeanTween.pause(fid); }
//===================================================== #region IPauseListener public void OnPauseEvent(bool isPaused) { // Manage active tween if (isPaused == true && _tweenId != -1) { LeanTween.pause(_tweenId); } else if (isPaused == false && _tweenId != -1) { LeanTween.resume(_tweenId); } }
private void Jump(int distance) { var jumpTime = JumpTime; LeanTween.pause(gameObject); OnTrampoline = false; Jumped = true; LeanTween.moveLocalX(gameObject, GetFallPosition(distance), jumpTime) .setOnComplete(() => { gameObject.MoveLeft(); }); LeanTween.moveLocalY(gameObject, transform.localPosition.y + Constants.JumpHight, jumpTime / 2) .setOnComplete(() => { LeanTween.moveLocalY(gameObject, transform.localPosition.y - Constants.JumpHight, jumpTime / 2).setOnComplete(() => { Jumped = false; }); }); }
public void PauseMove(bool value) { if (value) { LeanTween.pause(gameObject); } else { LeanTween.resume(gameObject); } Debug.Log("Is pause " + gameObject.name + ": " + LeanTween.isPaused(gameObject)); }
// Update is called once per frame void Update() { // Katsoo ettei kameralla rotaatio-käynnissä if (!LeanTween.isTweening(tweenID) && !tweaningPaused) { StartCoroutine(Rotate(angle, rotationTime)); } if (warningState || alarmState) { LeanTween.pause(tweenID); // Pysäytetään kameran rotaatio } }
// Update is called once per frame void Update() { target = GameObject.Find("Follow"); if (LevelManager.FeverActive && Vector3.Distance(this.gameObject.transform.position, target.transform.position) <= 20) { if (this.gameObject.GetComponent <Rigidbody>() == null) { this.gameObject.AddComponent <Rigidbody>(); } this.gameObject.GetComponent <Rigidbody>().useGravity = true; LeanTween.pause(this.gameObject); } }