Exemplo n.º 1
0
    public override void onEnter(PlayerStateController controller)
    {
        controller.rb.velocity      = Vector2.zero;
        controller.hook.parent      = null;
        controller.hookLine.enabled = true;
        _whereToShoot = controller.GetWhereToShoot();
        float rotZ = Mathf.Atan2(_whereToShoot.y, _whereToShoot.x) * Mathf.Rad2Deg;

        controller.hook.rotation = Quaternion.Euler(0, 0, rotZ + rotationOffset);
        controller.audioSource.PlayOneShot(controller.hookSound);
    }