private void Update()
 {
     if (rb.velocity.magnitude > 0f)
     {
         anim.Walking(true);
     }
     else
     {
         anim.Walking(false);
     }
 }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        characterSprite.rotation = Quaternion.Euler(0, 0, 0);

        if (Vector3.Distance(transform.position, targetPosition) < 0.5 && isMoving)
        {
            isMoving = false;
            ContinueSecuence();
        }

        /*if (GameManager.Instance.CurrentGameState == GameManager.GameState.RUNNING && isPauseSequence)
         * {
         *  ContinueSecuence();
         * }*/

        if (isMoving)
        {
            anim.Walking(true);
        }
        else
        {
            anim.Walking(false);
        }

        //debug
        if (Input.GetKeyDown("k"))
        {
            Debug.Log("pause");
            newSequ.Pause();
        }

        //debug
        if (Input.GetKeyDown("l"))
        {
            newSequ.Play();
        }
    }