Ejemplo n.º 1
0
 void OnEnable()
 {
     currentAnimation = animIdle;
     forward          = new Vector3(cameraTransform.forward.x, 0f, cameraTransform.forward.z).normalized;
     right            = new Vector3(cameraTransform.right.x, 0f, cameraTransform.right.z).normalized;
     rb        = GetComponent <Rigidbody>();
     xform     = GetComponent <Transform>();
     source    = GetComponent <AudioSource>();
     joeHockey = GameObject.FindGameObjectsWithTag("ShowTheJoe");
     avocados  = FindObjectsOfType <AvocadoController>();
 }
Ejemplo n.º 2
0
    IEnumerator SwingAnimation()
    {
        for (int i = 0; i < animSwing.Length; i++)
        {
            yield return(new WaitForSeconds(0.05f));

            currentAnimation = animSwing[i];
        }
        yield return(new WaitForSeconds(0.05f));

        currentAnimation = animIdle;
        isSwinging       = false;
        yield return(null);
    }