Playable demo build (no airship)

This commit is contained in:
2022-08-21 00:32:22 -07:00
parent aaa043470b
commit f3e9b25c48
89 changed files with 5820 additions and 5834 deletions

View File

@@ -5,8 +5,6 @@ namespace Scampz.GameJam.Assets.Scripts.Player
public class PlayerState : MonoBehaviour
{
private Animator _animator;
private RayCaster _rayCaster;
private bool _canMove;
private GameObject _player;
private CharacterController _characterController;
@@ -14,16 +12,17 @@ namespace Scampz.GameJam.Assets.Scripts.Player
private void Start()
{
_animator = GetComponent<Animator>();
_rayCaster = GetComponent<RayCaster>();
_player = GameObject.FindGameObjectWithTag("Player");
_characterController = _player.GetComponent<CharacterController>();
}
private void Update()
{
_canMove = true;
_animator.SetFloat("Speed", _characterController.velocity.magnitude);
if (_rayCaster.enabled)
_canMove = _rayCaster.IsWithinBounds();
var rayCasterExists = TryGetComponent<RayCaster>(out var rayCaster);
if (rayCasterExists)
_canMove = rayCaster.IsWithinBoundsWithRay();
}
public bool CanMove => _canMove;