feat: Water shader contact
This commit is contained in:
@@ -16,6 +16,7 @@ public class Player : MonoBehaviour
|
||||
Idle,
|
||||
Moving,
|
||||
Jumping,
|
||||
JumpingDouble,
|
||||
Falling,
|
||||
Dashing,
|
||||
Stunned,
|
||||
@@ -666,7 +667,10 @@ public class Player : MonoBehaviour
|
||||
{
|
||||
if (State.VerticalVelocity > 0)
|
||||
{
|
||||
State.CurrentState = PlayerState.Jumping;
|
||||
if (!_doubleJump)
|
||||
State.CurrentState = PlayerState.Jumping;
|
||||
else
|
||||
State.CurrentState = PlayerState.JumpingDouble;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
[System.Serializable]
|
||||
private class PlayerAnimationStateMapper
|
||||
{
|
||||
[HideInInspector] public string Name;
|
||||
public Player.PlayerState PlayerState;
|
||||
public string AnimatorState;
|
||||
public string BlockingState;
|
||||
@@ -45,11 +46,12 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
private void Init()
|
||||
{
|
||||
_stateMapper = new PlayerAnimationStateMapper[9];
|
||||
_stateMapper = new PlayerAnimationStateMapper[10];
|
||||
int i = 0;
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Idle.ToString(),
|
||||
PlayerState = Player.PlayerState.Idle,
|
||||
AnimatorState = "move",
|
||||
BlockingState = "",
|
||||
@@ -58,6 +60,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Moving.ToString(),
|
||||
PlayerState = Player.PlayerState.Moving,
|
||||
AnimatorState = "move",
|
||||
BlockingState = "",
|
||||
@@ -66,6 +69,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Jumping.ToString(),
|
||||
PlayerState = Player.PlayerState.Jumping,
|
||||
AnimatorState = "jump",
|
||||
BlockingState = "fall",
|
||||
@@ -74,6 +78,16 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.JumpingDouble.ToString(),
|
||||
PlayerState = Player.PlayerState.JumpingDouble,
|
||||
AnimatorState = "jumpRoll",
|
||||
BlockingState = "fall",
|
||||
Trigger = "trigger_jumpRoll",
|
||||
};
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Dashing.ToString(),
|
||||
PlayerState = Player.PlayerState.Dashing,
|
||||
AnimatorState = "dash",
|
||||
BlockingState = "",
|
||||
@@ -82,6 +96,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Falling.ToString(),
|
||||
PlayerState = Player.PlayerState.Falling,
|
||||
AnimatorState = "fall",
|
||||
BlockingState = "jump",
|
||||
@@ -90,6 +105,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Stunned.ToString(),
|
||||
PlayerState = Player.PlayerState.Stunned,
|
||||
AnimatorState = "stun",
|
||||
BlockingState = "",
|
||||
@@ -98,6 +114,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Dead.ToString(),
|
||||
PlayerState = Player.PlayerState.Dead,
|
||||
AnimatorState = "eliminate",
|
||||
BlockingState = "",
|
||||
@@ -106,6 +123,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Loser.ToString(),
|
||||
PlayerState = Player.PlayerState.Loser,
|
||||
AnimatorState = "lose",
|
||||
BlockingState = "",
|
||||
@@ -114,6 +132,7 @@ public class PlayerAnimation : MonoBehaviour
|
||||
|
||||
_stateMapper[i++] = new PlayerAnimationStateMapper()
|
||||
{
|
||||
Name = Player.PlayerState.Winner.ToString(),
|
||||
PlayerState = Player.PlayerState.Winner,
|
||||
AnimatorState = "win",
|
||||
BlockingState = "",
|
||||
|
||||
@@ -88,6 +88,7 @@ public class PlayerDie : MonoBehaviour
|
||||
Player.Instance.Pause();
|
||||
Player.Instance.SetState(Player.PlayerState.Loser);
|
||||
transform.position = Player.Instance.transform.position;
|
||||
transform.rotation = Player.Instance.transform.rotation;
|
||||
_references.UI.gameObject.SetActive(true);
|
||||
_respawned = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user