Added Kenney Art, updated some code to use art better
This commit is contained in:
@@ -12,6 +12,7 @@ public class Player : MonoBehaviour
|
||||
public float fireRate;
|
||||
public GameObject projectileGo;
|
||||
public Transform projectileSpawn;
|
||||
public Transform barrelTransform;
|
||||
|
||||
private Transform _transform;
|
||||
private Vector3 _position;
|
||||
@@ -61,25 +62,27 @@ public class Player : MonoBehaviour
|
||||
angle *= -1;
|
||||
}
|
||||
|
||||
_transform.eulerAngles = Vector3.forward * angle;
|
||||
//_transform.eulerAngles = Vector3.forward * angle;
|
||||
barrelTransform.eulerAngles = Vector3.forward * angle;
|
||||
}
|
||||
|
||||
private void JoystickAim()
|
||||
{
|
||||
|
||||
// TOOD:
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var direction = movement.ReadValue<Vector2>();
|
||||
direction.Normalize();
|
||||
_transform.up = direction;
|
||||
direction *= speed * Time.deltaTime;
|
||||
|
||||
_position.x = direction.x;
|
||||
_position.y = direction.y;
|
||||
_position.z = 0;
|
||||
_transform.position += _position;
|
||||
|
||||
|
||||
_aimingFunction();
|
||||
|
||||
if (_wantFire && _lastFireTime + (1 / fireRate) < Time.time)
|
||||
|
||||
Reference in New Issue
Block a user