private Quaternion qRotation;                           //This allows me to calculate it in Update and apply it in FixedUpdate.

    private void Start()
    {
        rb             = GetComponent <Rigidbody>();
        animController = GetComponent <HeroAnimationController>();
        InputHandler.PlayerController.onMove += CalculateMovement;
        InputHandler.PlayerController.onAim  += CalculateRotation;
    }
Exemple #2
0
 void Awake()
 {
     mHeroAnimationController = gameObject.GetComponent <HeroAnimationController> ();
     HeroRigidbody2D          = gameObject.GetComponent <Rigidbody2D> ();
 }