KeepItUp/Assets/_Scripts/PlayerScripts/PlayerCollisions.cs
2022-07-20 20:06:57 +03:00

19 lines
474 B
C#

using UnityEngine;
public class PlayerCollisions : MonoBehaviour
{
[SerializeField] private ScoreManager _scoreManager;
private void OnCollisionEnter2D(Collision2D coll)
{
switch (coll.gameObject.tag)
{
case "Wall":
PlayerEvents.SendWallTouched();
break;
case "Floor":
GameStateManager.Instance.ChangeState(GameState.GameOver);
break;
}
}
}