Skip to content

Commit

Permalink
- update: Runtime auto init data
Browse files Browse the repository at this point in the history
  • Loading branch information
DucNV2000 committed Jul 31, 2024
1 parent 850b8bb commit 9e06036
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Runtime/GameData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ public static class GameData

#region Internal Stuff

[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void RuntimeInit()
{
Init();
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Init()
{
if (isInitialized) return;
isInitialized = true;
Load();
Debug.Log($"<color=Green>GameData Initialized</color>");
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 9e06036

Please sign in to comment.