Added a deathzone that plays a death animation on trigger, fades the screen, respawns the player at the last known safe position and the fades the screen back in. Added scripts for safezone and deathzone. Added some make do animations and animators. Added some materials for testing purposes.
29 lines
671 B
C#
29 lines
671 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PlayerController : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private PlayerMovementSettings _movementSettings;
|
|
|
|
[SerializeField]
|
|
private PlayerInputHandler _inputHandler;
|
|
|
|
[SerializeField]
|
|
private Rigidbody _rigidbody;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
Vector2 moveVector2 = _inputHandler.InputState.Move.Value;
|
|
Vector3 moveVector = new Vector3( moveVector2.x, 0f, moveVector2.y );
|
|
|
|
_rigidbody.velocity = moveVector * _movementSettings.BaseMovementSpeed;
|
|
|
|
}
|
|
} |