コード例 #1
0
        void LoadAndSetHighScore()
        {
            thisPlayerDataManager.SetFileIndex(0);
            if (!thisPlayerDataManager.PlayerDataIsLoaded())
            {
                thisPlayerDataManager.Load();
            }
            int highScore = thisPlayerDataManager.GetHighScore();

            thisScoreManager.SetHighScore(highScore);

            thisPlayerDataManager.Save();
        }
コード例 #2
0
        void SavePlayerData()
        {
            IPlayerDataManager manager = playerDataManagerAdaptor.GetPlayerDataManager();

            manager.SetFileIndex(thisSelectedFileIndex);
            manager.Save();
        }
コード例 #3
0
        void DrawFileSwitch(Rect rect)
        {
            if (thisSystemIsReady)
            {
                IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager();

                string[] filePaths = playerDataManager.GetFilePaths();

                string[] buttonTexts           = CreateFilesNameArray(filePaths);
                int      prevSelectedFileIndex = thisSelectedFileIndex;
                thisSelectedFileIndex = GUI.SelectionGrid(
                    rect,
                    thisSelectedFileIndex,
                    buttonTexts,
                    filePaths.Length
                    );
                if (thisSelectedFileIndex > filePaths.Length - 1)
                {
                    thisSelectedFileIndex = filePaths.Length - 1;
                }

                if (thisSelectedFileIndex != prevSelectedFileIndex)
                {
                    playerDataManager.SetFileIndex(thisSelectedFileIndex);
                }
                prevSelectedFileIndex = thisSelectedFileIndex;
            }
            else
            {
                GUI.Box(
                    rect,
                    "ready the system to load files"
                    );
            }
        }
コード例 #4
0
        void LoadPlayerData()
        {
            IPlayerDataManager manager = playerDataManagerAdaptor.GetPlayerDataManager();

            manager.SetFileIndex(thisSelectedFileIndex);
            manager.Load();
            CalculateShootingData();
        }
コード例 #5
0
        void LoadAndFeedAllPanelsWithPlayerData()
        {
            thisPlayerDataManager.SetFileIndex(0);
            thisPlayerDataManager.Load();
            int equippedBowIndex = thisPlayerDataManager.GetEquippedBowIndex();

            IBowConfigData[] configDataArray = thisPlayerDataManager.GetBowConfigDataArray();

            foreach (IBowPanel bowPanel in thisBowPanels)
            {
                int            bowIndex      = bowPanel.GetIndex();
                IBowConfigData bowConfigData = configDataArray[bowIndex];
                if (!bowConfigData.IsUnlocked())
                {
                    bowPanel.Lock(instantly: true);
                }
                else
                {
                    bowPanel.Unlock(instantly: true);
                }
                if (bowIndex == equippedBowIndex)
                {
                    bowPanel.SetEquippedness(isEquipped: true, instantly: true);
                }
                else
                {
                    bowPanel.SetEquippedness(isEquipped: false, instantly: true);
                }

                int bowLevel = bowConfigData.GetBowLevel();
                bowPanel.SetBowLevel(bowLevel, instantly: false);

                UpdateAttributePanel(bowPanel, bowConfigData);
            }
            UpdateUnlockButtons();
        }