|
@ -4,6 +4,8 @@ using UnityEngine; |
|
|
|
|
|
|
|
|
public class DragonMovement : MonoBehaviour |
|
|
public class DragonMovement : MonoBehaviour |
|
|
{ |
|
|
{ |
|
|
|
|
|
const bool ROTATE_WITH_FLAP = false; |
|
|
|
|
|
|
|
|
[SerializeField] KeyCode FlapKey; |
|
|
[SerializeField] KeyCode FlapKey; |
|
|
Rigidbody2D _rigidbody; |
|
|
Rigidbody2D _rigidbody; |
|
|
float _flapTime = 0f; |
|
|
float _flapTime = 0f; |
|
@ -206,6 +208,7 @@ public class DragonMovement : MonoBehaviour |
|
|
{ |
|
|
{ |
|
|
_flapTime = FlapLength; |
|
|
_flapTime = FlapLength; |
|
|
_animator.Play("fly"); |
|
|
_animator.Play("fly"); |
|
|
|
|
|
transform.eulerAngles = new Vector3(-45f, transform.eulerAngles.y, transform.eulerAngles.z); |
|
|
ShowNormalAmmo(); |
|
|
ShowNormalAmmo(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -258,6 +261,10 @@ public class DragonMovement : MonoBehaviour |
|
|
_flapTime = 0f; |
|
|
_flapTime = 0f; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else if (_flapTime > 0 && ROTATE_WITH_FLAP) |
|
|
|
|
|
{ |
|
|
|
|
|
transform.eulerAngles = new Vector3(0f, 0f, 30f); |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
transform.rotation = Quaternion.identity; |
|
|
transform.rotation = Quaternion.identity; |
|
|