diff --git a/Assets/Scripts/Basic.meta b/Assets/Scripts/Basic.meta new file mode 100644 index 0000000..8d93d68 --- /dev/null +++ b/Assets/Scripts/Basic.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 799293e920c24f42b0ded460fcdd845e +timeCreated: 1731086558 \ No newline at end of file diff --git a/Assets/Scripts/Basic/ClearStatic.cs b/Assets/Scripts/Basic/ClearStatic.cs new file mode 100644 index 0000000..3d5229b --- /dev/null +++ b/Assets/Scripts/Basic/ClearStatic.cs @@ -0,0 +1,15 @@ +using System; +using GameOff.Core; +using UnityEngine; + +namespace GameOff.Basic +{ + [DefaultExecutionOrder(-200)] + public class ClearStatic: MonoBehaviour + { + private void Awake() + { + PlayerMain.ClearStaticVariables(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Basic/ClearStatic.cs.meta b/Assets/Scripts/Basic/ClearStatic.cs.meta new file mode 100644 index 0000000..9e7addb --- /dev/null +++ b/Assets/Scripts/Basic/ClearStatic.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e4f03d0416944ce7b510499a9d57eff1 +timeCreated: 1731086571 \ No newline at end of file diff --git a/Assets/Scripts/Core/PlayerMain.cs b/Assets/Scripts/Core/PlayerMain.cs index 8234a12..2b43e80 100644 --- a/Assets/Scripts/Core/PlayerMain.cs +++ b/Assets/Scripts/Core/PlayerMain.cs @@ -7,7 +7,11 @@ namespace GameOff.Core public class PlayerMain : MonoBehaviour { public static PlayerMain Instance { get; private set; } - + public static void ClearStaticVariables() + { + Instance = null; + } + public event EventHandler OnStateUpdate; private PlayerInputHandler _inputHandler;