예제 #1
0
    // 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();
    }
예제 #2
0
    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();
    }
예제 #3
0
    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();
    }
예제 #4
0
    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();
    }