public float velRotationZ;
public float velRotationY;
public float velRotationX;
public float velMoveZ;
public GameObject bullet;
public GameObject explosion;
public float bulletGap;
private float firstShootTime;
private bool shooting;
void MoveNave ()
{
if (Input.GetAxis ("Vertical") < 0) {
transform.Rotate (new Vector3 (velRotationX * Time.deltaTime, 0, 0));
} else if (Input.GetAxis ("Vertical") > 0) {
transform.Rotate (new Vector3 (-velRotationX * Time.deltaTime, 0, 0));
}
if (Input.GetAxis ("Horizontal") > 0) {
if (Mathf.Sin (transform.eulerAngles.z * Mathf.PI / 180) <= 0.5f) {
transform.eulerAngles += new Vector3 (0, 0, velRotationZ * Time.deltaTime);
animation.CrossFade ("left");
}
} else if (Input.GetAxis ("Horizontal") < 0) {
if (Mathf.Sin (transform.eulerAngles.z * Mathf.PI / 180) >= -0.5f) {
transform.eulerAngles += new Vector3 (0, 0, -velRotationZ * Time.deltaTime);
animation.CrossFade ("right");
}
}
if (Mathf.Sin (transform.eulerAngles.z * Mathf.PI / 180) < 0) {
transform.eulerAngles += new Vector3 (0, -velRotationY * Time.deltaTime * ((-transform.eulerAngles.z + 360f) / 30f), 0);
}
if (Mathf.Sin (transform.eulerAngles.z * Mathf.PI / 180) > 0) {
transform.eulerAngles += new Vector3 (0, velRotationY * Time.deltaTime * transform.eulerAngles.z / 30f, 0);
}
if (Input.GetAxis ("Horizontal") == 0)
animation.CrossFade ("idle");
transform.position += transform.forward * -velMoveZ * Time.deltaTime;
}