private void Start() { // IMPORTANT: initial the path before save and load! InitPath(); // only load once if (GAME_DATA == null) { LoadGameData(); } GAME_MODE = FindGameMode(PLAYER_IN_GAME); // set load and save game data JCS_GameSettings.instance.SAVE_GAME_DATA_FUNC = SaveGameData; JCS_GameSettings.instance.LOAD_GAME_DATA_FUNC = LoadGameData; }
//---------------------- // Private Variables //---------------------- // Protected Variables //======================================== // setter / getter //------------------------------ //======================================== // Unity's function //------------------------------ private void Awake() { if (instance != null) { TransferData(instance, this); // Delete the old one DestroyImmediate(instance.gameObject); } instance = this; // IMPORTANT(JenChieh): initial the path // before save and load! InitPath(); // only load once if (RC_GAME_DATA == null) { LoadGameData(); } GAME_MODE = FindGameMode(PLAYER_IN_GAME); }