// File management static public void Create() { if (m_Instance == null) { m_Instance = new PlayerData(); //if we create the PlayerData, mean it's the very first call, so we use that to init the database //this allow to always init the database at the earlier we can, i.e. the start screen if started normally on device //or the Loadout screen if testing in editor AssetBundlesDatabaseHandler.Load(); } m_Instance.saveFile = Application.persistentDataPath + "/save.bin"; if (File.Exists(m_Instance.saveFile)) { // If we have a save, we read it. m_Instance.Read(); } else { // If not we create one with default data. NewSave(); } m_Instance.CheckMissionsCount(); }
protected ShopLIst m_OpenList;//当前打开的界面 void Start() { PlayerData.Create(); consumableDatabase.Load(); AssetBundlesDatabaseHandler.Load(); #if UNITY_ANALYTICS AnalyticsEvent.StoreOpened(StoreType.Soft); #endif m_OpenList = itemList; itemList.Open(); }
void Start() { PlayerData.Create(); consumableDatabase.Load(); AssetBundlesDatabaseHandler.Load(); #if UNITY_ANALYTICS AnalyticsEvent.StoreOpened(StoreType.Soft); #endif #if !UNITY_EDITOR && !DEVELOPMENT_BUILD //Disable cheating on non dev build outside of the editor cheatButton.interactable = false; #else cheatButton.interactable = true; #endif m_OpenList = itemList; itemList.Open(); }
public static void Create() { if (m_Instance == null) { m_Instance = new PlayerData(); AssetBundlesDatabaseHandler.Load(); } m_Instance.saveFile = Application.persistentDataPath + "/save.bin"; if (File.Exists(m_Instance.saveFile)) { //如果我们有保存的数据,则进行加载 m_Instance.Read(); } else { NewSave(); } m_Instance.CheckMissionsCount(); }