Add utils + refacto
This commit is contained in:
@@ -1,22 +1,9 @@
|
||||
using UnityEngine;
|
||||
using Unheimlich.Core;
|
||||
|
||||
namespace Unheimlich.Gameplay.Player
|
||||
{
|
||||
/// <summary>
|
||||
/// Singleton player reference accessible globally throughout the game.
|
||||
/// </summary>
|
||||
public class Player : MonoBehaviour
|
||||
public class Player : Singleton<Player>
|
||||
{
|
||||
public static Player Instance { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Destroy(this);
|
||||
return;
|
||||
}
|
||||
Instance = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user