Files
Click-PointRPG/Assets/Scripts/Player.cs

29 lines
580 B
C#
Raw Normal View History

2026-02-10 21:27:46 +00:00
using UnityEngine;
public class Player : Character
{
2026-02-11 17:30:49 +00:00
public static Player current { get; private set; }
2026-02-10 21:27:46 +00:00
void Awake()
{
2026-02-11 17:30:49 +00:00
if (current != null && current != this)
{
Debug.LogWarning("Multiple Player instances detected. Destroying duplicate.", gameObject);
Destroy(gameObject);
return;
}
current = this;
2026-02-10 21:27:46 +00:00
}
void OnDestroy()
{
2026-02-11 17:30:49 +00:00
if (current == this) current = null;
2026-02-10 21:27:46 +00:00
}
public override void Die()
{
base.Die();
// add player-specific death logic here
}
}