pause() публичный статический Метод

public static pause ( GameObject gameObject ) : void
gameObject GameObject
Результат void
Пример #1
0
 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();
     }
 }
Пример #2
0
        // Code that runs on entering the state.
        public override void OnEnter()
        {
            GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);

            LeanTween.pause(go);
            Finish();
        }
Пример #3
0
 private void Start()
 {
     spriteRenderer    = GetComponent <SpriteRenderer>();
     pingPongAnimation = LeanTween.scale(gameObject, Vector2.one * scaleSize, scaleTime).setEaseInOutBack().setLoopPingPong().id;
     LeanTween.pause(pingPongAnimation);
     SetShieldAlphaTo(0f);
 }
Пример #4
0
    //=====================================================

    #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);
        }
    }
Пример #5
0
    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);
    }
Пример #6
0
    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);
    }
Пример #7
0
 private void FreezeScoop()
 {
     if (verticalScoopTween != null)
     {
         Debug.Log("Freezing scoop: " + flavor, gameObject);
         LeanTween.pause(verticalScoopTween.id);
     }
 }
Пример #8
0
 private void FadeOutAndStopShield()
 {
     LeanTween.alpha(gameObject, 0, 1f).setOnComplete(() =>
     {
         LeanTween.pause(pingPongAnimation);
         shieldIsOn = false;
     });
 }
Пример #9
0
    //   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));
    }
Пример #10
0
 public void OpenDisplay(GameObject player)
 {
     if (interactable)
     {
         EventSystemGame.current.PlaySound("Pop");
         GetComponentInChildren <Canvas>().enabled = true;
         LeanTween.pause(gameObject);
     }
 }
Пример #11
0
 public void StopTap()
 {
     if (tapping)
     {
         tapping = false;
         LeanTween.pause(gameObject);
         Fade(0, .3f);
     }
 }
Пример #12
0
    public void Pause()
    {
        enabled = false;

        if (mLeanTweenActiveAnimID1 != -1)
        {
            LeanTween.pause(mLeanTweenActiveAnimID1);
        }
    }
Пример #13
0
	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);
        }
    }
Пример #14
0
 public void Pause()
 {
     // NOTE: LT breaks if you call it twice directly
     if (!isPauseCheck)
     {
         isPauseCheck = true;
         LeanTween.pause(gameObject);
     }
 }
Пример #15
0
 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);
 }
Пример #16
0
 protected override void _Pause()
 {
     if (petInstance)
     {
         petInstance.GetComponentInChildren <Animator>().enabled = false;
     }
     LeanTween.pause(inhalerButton);
     LeanTween.pause(dayBackground);
     LeanTween.pause(nightBackground);
 }
Пример #17
0
 void CheckTargetUpdate(float f)
 {
     if (TargetItem.destroying || TargetItem == null || !TargetItem.gameObject.activeSelf)
     {
         StopCoroutine(FindTargetLoop());
         LeanTween.pause(gameObject);
         TargetItem = null;
         StartCoroutine(FindTargetLoop());
     }
 }
Пример #18
0
 public void PauseAnimations()
 {
     for (int i = 0; i < texts.Length; ++i)
     {
         if (!texts[i].gameObject.activeInHierarchy)
         {
             continue;
         }
         LeanTween.pause(texts[i].gameObject);
     }
 }
Пример #19
0
 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);
     });
 }
Пример #20
0
 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);
     }
 }
Пример #21
0
    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);
    }
Пример #22
0
    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);
    }
Пример #23
0
	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());
		}
	}
Пример #24
0
    /*
     * 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);
    }
Пример #25
0
    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);
    }
Пример #26
0
    //=====================================================

    #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);
        }
    }
Пример #27
0
        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; }); });
        }
Пример #28
0
    public void PauseMove(bool value)
    {
        if (value)
        {
            LeanTween.pause(gameObject);
        }
        else
        {
            LeanTween.resume(gameObject);
        }

        Debug.Log("Is pause " + gameObject.name + ": " + LeanTween.isPaused(gameObject));
    }
Пример #29
0
    // 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
        }
    }
Пример #30
0
    // 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);
        }
    }