Ejemplo n.º 1
0
        private void LoadData()
        {
            // This can be read and written from multiple scripts at the same time.
            // It uses a file with a name. Returns null only if the name is invalid.
            // mScriptStorage = Game.GetSharedStorage(MY_SCRIPT_STORAGE_ID);

            // No file involved in with this method.
            // Data will not persist once the server restarts or the map is changed
            // While restarting sessions on the same map, the data will persist.
            // mScriptStorage = Game.SessionStorage;

            // This is tied to my script. It uses a file.
            mScriptStorage = Game.LocalStorage;



            if (mScriptStorage.ContainsKey(SHOTS_FIRED_KEY))
            {
                if (!mScriptStorage.TryGetItemInt(SHOTS_FIRED_KEY, out mTotalShotsFiredCount))
                {
                    mTotalShotsFiredCount = 0;
                }
            }
        }