Пример #1
0
        /// <summary>
        /// Initialize the custom lobby data
        /// </summary>
        private void InitCustomLobbyData()
        {
            // Set the save file instance
            m_LobbyDataFile = new SaveFiles(Application.dataPath, "LobbyData", ".json");

            // Create a new CustomLobbyData instance
            m_CustomLobbyData = new CustomLobbyData()
            {
                PlayerLimit = m_PlayerScaler.scaleValue,
                EnemyLimit  = m_EnemyScaler.scaleValue
            };
        }
Пример #2
0
        /// <summary>
        /// Button event
        /// </summary>
        public void BTN_LoadData()
        {
            // Load the data
            m_CustomLobbyData = m_LobbyDataFile.Load(m_CustomLobbyData);
            m_DifficultyData  = m_DifficultyDataFile.Load(m_DifficultyData);

            // Set the loaded data
            m_PlayerScaler.scaleValue     = m_CustomLobbyData.PlayerLimit;
            m_EnemyScaler.scaleValue      = m_CustomLobbyData.EnemyLimit;
            m_DifficultyScaler.scaleValue = m_DifficultyData.Difficulty;

            // Update the ingame UI
            m_PlayerScaler.UpdateText();
            m_EnemyScaler.UpdateText();
            m_DifficultyScaler.UpdateText();
        }