예제 #1
0
 public void OnOverwriteSlot(int _slot)
 {
     if (!lockSlots)
     {
         if (File.Exists(validFiles[_slot]))
         {
             saveDataManager.Save(validFiles[_slot]);
         }
         UpdateSaveList();
     }
 }
예제 #2
0
 private void AfterAdProcess()
 {
     lastAdShown = Time.realtimeSinceStartup;
     SaveDataManager.getValue.gameStatus = statusBeforAd;
     SaveDataManager.Save();
     Time.timeScale = 1f;
 }
예제 #3
0
 public void Logout()
 {
     // Check if already Signed out
     if (!isAuthenticated())
     {
         SetResult("Erfolgreich abgemeldet.", "Successfully logged out.");
         return;
     }
     // Save login status
     SaveDataManager.getValue.playGamesAutomaticAuth = false;
     SaveDataManager.Save();
     // Init iff not done jet
     if (!initialized)
     {
         initPlayGamesServices();
     }
     // Singout
     try {
         PlayGamesPlatform.Instance.SignOut();
         SetResult("Erfolgreich abgemeldet.", "Successfully logged out.");
     } catch (Exception e) {
         Debug.LogError(e);
         SetResult("Fehler beim abmelden", "Error during logout.");
     }
 }
예제 #4
0
        public async Task UpdateChannelAsync([Summary("The channel. Make sure you mention the channel with '#'.")] string channelMention)
        {
            ulong id;

            if (ulong.TryParse(channelMention.Replace("<", "").Replace(">", "").Replace("#", ""), out id))
            {
                foreach (var guildData in SaveDataManager.saveData.guildDataList)
                {
                    if (guildData.guildId == Context.Guild.Id)
                    {
                        guildData.channelId = id;
                        SaveDataManager.Save();
                        await ReplyAsync("Updated channel!");

                        return;
                    }
                }

                SaveDataManager.saveData.guildDataList.Add(new GuildData(Context.Guild.Id, id));
                SaveDataManager.Save();
                await ReplyAsync("Updated channel!");
            }
            else
            {
                await ReplyAsync("Can't get channel. Be sure to mention it with '#'.");
            }
        }
예제 #5
0
 public void ButtonSpecialAdsContinueNotification()
 {
     SaveDataManager.getValue.notificationAdsFinished = true;
     SaveDataManager.Save();
     // SceneManager.callSceneSettings();
     ButtonSpecialAds();
 }
예제 #6
0
    public void ButtonSettingsVibration()
    {
        switch (SaveDataManager.getValue.settingsVibration)
        {
        case SettingsVibration.Off:
            SaveDataManager.getValue.settingsVibration = SettingsVibration.Short;
            break;

        case SettingsVibration.Short:
            SaveDataManager.getValue.settingsVibration = SettingsVibration.Medium;
            break;

        case SettingsVibration.Medium:
            SaveDataManager.getValue.settingsVibration = SettingsVibration.Long;
            break;

        case SettingsVibration.Long:
            SaveDataManager.getValue.settingsVibration = SettingsVibration.Off;
            break;

        default:
            SaveDataManager.getValue.settingsVibration = SettingsVibration.Medium;
            break;
        }
        SaveDataManager.Save();
        VibrationManager.Setup();
        OESettings.instance.UpdateButtonUIVibration();
        VibrationManager.Vibrate();
    }
예제 #7
0
    public void ButtonSettingsSound()
    {
        switch (SaveDataManager.getValue.settingsSound)
        {
        case SettingsSounds.All:
            SaveDataManager.getValue.settingsSound = SettingsSounds.Sound;
            SoundScript.instance.SoundOnlySound();
            break;

        case SettingsSounds.Sound:
            SaveDataManager.getValue.settingsSound = SettingsSounds.Off;
            SoundScript.instance.SoundOff();
            break;

        case SettingsSounds.Off:
            SaveDataManager.getValue.settingsSound = SettingsSounds.All;
            SoundScript.instance.SoundOn();
            break;

        default:
            SaveDataManager.getValue.settingsSound = SettingsSounds.All;
            SoundScript.instance.SoundOn();
            break;
        }
        SaveDataManager.Save();
        OESettings.instance.UpdateButtonUISound();
    }
예제 #8
0
 private void BeforeAdProcess()
 {
     statusBeforAd = SaveDataManager.getValue.gameStatus;
     SaveDataManager.getValue.gameStatus = GameStatus.advert;
     SaveDataManager.Save();
     Time.timeScale = 0f;
 }
예제 #9
0
        static void Save()
        {
            Console.WriteLine("Name?");
            string name = Console.ReadLine();

            Console.WriteLine("Number?");
            float number;

            if (!float.TryParse(Console.ReadLine(), out number))
            {
                Debug.Log("Must input float value.");
                //Console.WriteLine("Must input float value.");
                return;
            }

            Console.WriteLine("Count?");
            int count;

            if (!int.TryParse(Console.ReadLine(), out count))
            {
                Debug.Log("Must input int value.");
                //Console.WriteLine("Must input int value.");
                return;
            }

            SaveData data = new SaveData
            {
                Name   = name,
                Number = number,
                Count  = count,
            };

            SaveDataManager.Save(data);
        }
예제 #10
0
 public override void UpdateLevel()
 {
     if (SaveDataManager.getValue.shrinkItemLVL < 3)
     {
         SaveDataManager.getValue.shrinkItemLVL++;
         SaveDataManager.Save();
     }
 }
예제 #11
0
    public void Login(bool withUI)
    {
        // Check if already Signed in
        if (isAuthenticated() || ConstantManager.demoMode)
        {
            if (withUI && !ConstantManager.demoMode)
            {
                SetResult("Erfolgreich angemeldet.", "Logged in successfully.");
            }
            return;
        }
        // Prevent Double-Action
        if (withUI)
        {
            UiObjectReferrer.instance.notificationLoginContinueBDE.interactable = false;
            UiObjectReferrer.instance.notificationLoginContinueBEN.interactable = false;
            UiObjectReferrer.instance.notificationLoginBackBDE.interactable     = false;
            UiObjectReferrer.instance.notificationLoginBackBEN.interactable     = false;
            UiObjectReferrer.instance.notificationLoginContinueTDE.color        = new Color32(255, 255, 255, 90);
            UiObjectReferrer.instance.notificationLoginContinueTEN.color        = new Color32(255, 255, 255, 90);
            UiObjectReferrer.instance.notificationLoginBackTDE.color            = new Color32(255, 255, 255, 90);
            UiObjectReferrer.instance.notificationLoginBackTEN.color            = new Color32(255, 255, 255, 90);
        }
        // Init if not done jet
        if (!initialized)
        {
            initPlayGamesServices();
        }
        // Authenticate
        try {
            Social.localUser.Authenticate((bool success) => {
                if (success)
                {
                    if (withUI)
                    {
                        SetResult("Erfolgreich angemeldet.", "Logged in successfully.");
                    }
                }
                else
                {
                    if (withUI)
                    {
                        SetResult("Fehler beim anmelden.", "Error during login.");
                    }
                }
            });
        } catch (Exception e) {
            Debug.LogError(e);
            SetResult("Die Authentifizierung ist fehlgeschlagen.", "An Error occured during Authentification.");
        }

        // Save login status
        if (withUI)
        {
            SaveDataManager.getValue.playGamesAutomaticAuth = true;
            SaveDataManager.Save();
        }
    }
예제 #12
0
    public void SetupEndgame()
    {
        SaveDataManager.getValue.statsTotalGamesPlayed += preRevive.totalGamesPlayed + postRevive.totalGamesPlayed;
        SaveDataManager.getValue.statsTotleCountRevive += preRevive.totalCountRevive + postRevive.totalCountRevive;
        // STATS
        SaveDataManager.getValue.statsTotalParticles += value.particlesSpawned;
        // Normal Particles
        SaveDataManager.getValue.statsTotalNormalParticlesSpawned   += value.normalParticlesSpawned;
        SaveDataManager.getValue.statsTotalNormalParticlesDestroyed += value.normalParticlesDestroyed;
        SaveDataManager.getValue.statsTotalNormalParticlesCollected += value.normalParticlesCollected;
        SaveDataManager.getValue.statsTotalGainedMass += value.gainedMass;
        // Shrink Particles
        SaveDataManager.getValue.statsTotalShrinkParticlesSpawned   += value.shrinkParticlesSpawned;
        SaveDataManager.getValue.statsTotalShrinkParticlesDestroyed += value.shrinkParticlesDestroyed;
        SaveDataManager.getValue.statsTotalShrinkParticlesCollected += value.shrinkParticlesCollected;
        SaveDataManager.getValue.statsTotalLossMass += value.lossMass;
        // Gold Particles
        SaveDataManager.getValue.statsTotalGoldParticlesSpawned   += value.goldParticlesSpawned;
        SaveDataManager.getValue.statsTotalGoldParticlesDestroyed += value.goldParticlesDestroyed;
        SaveDataManager.getValue.statsTotalGoldParticlesCollected += value.goldParticlesCollected;
        SaveDataManager.getValue.statsTotalGainedGold             += value.goldMassCollected;
        // Projectiles
        SaveDataManager.getValue.statsTotalProjectilesFired += value.projectilesFiredTotal;
        SaveDataManager.getValue.statsTotalProjectilesHit   += value.projectilesHitTotal;
        // Input
        SaveDataManager.getValue.statsTotalInputSwipe += value.inputSwipeCount;
        SaveDataManager.getValue.statsTotalInputTab   += value.inputTabCount;
        // Time
        value.roundTime = Time.realtimeSinceStartup - value.startTime;
        SaveDataManager.getValue.totalTimeIngame += value.roundTime;
        // Score
        SaveDataManager.getValue.scoreTotal += value.score;
        GoldScript.instance.EarnGold(value.goldMassCollected);
        if (ScoreScript.instance.newHighscore)
        {
            GoogleLoginScript.instance.SetNewHighscore((int)value.highscore, GPGSIds.leaderboard_highscore);
            SaveDataManager.getValue.highscore = value.highscore;
            SaveDataManager.getValue.highscoreRoundDataGrow   = preRevive.normalParticlesDestroyed + postRevive.normalParticlesDestroyed;
            SaveDataManager.getValue.highscoreRoundDataShrink = preRevive.shrinkParticlesCollected + postRevive.shrinkParticlesCollected;
            SaveDataManager.getValue.highscoreRoundDataGold   = preRevive.goldMassCollected + postRevive.goldMassCollected;
            SaveDataManager.getValue.highscoreRoundDataTime   = preRevive.roundTime + postRevive.roundTime;
        }
        // Achievements
        if (ScoreScript.instance.difficultFactor > SaveDataManager.getValue.maxReachedDifficulty)
        {
            SaveDataManager.getValue.maxReachedDifficulty = ScoreScript.instance.difficultFactor;
        }
        // Level
        value.levelPointsForDestroy  = value.normalParticlesDestroyed + value.goldParticlesCollected + value.shrinkParticlesCollected;
        value.levelPointsForDistance = (int)value.roundTime;
        SaveDataManager.getValue.currentLevelPoints += value.levelPointsForDestroy + value.levelPointsForDistance;
        var lvlCalculation = GetCurrentLevel();

        SaveDataManager.getValue.currentLevel = lvlCalculation[0];
        SaveDataManager.getValue.currentRemainingLevelPoints = lvlCalculation[1];

        SaveDataManager.Save();
    }
예제 #13
0
    //SETTINGS
    public void ButtonSettingLanguage()
    {
        var lang = SaveDataManager.getValue.settingsLanguage;

        SaveDataManager.getValue.settingsLanguage   = lang == SettingsLanguages.English ? SettingsLanguages.German : SettingsLanguages.English;
        SaveDataManager.getValue.languageManualySet = true;
        SaveDataManager.Save();
        LanguageScript.UpdateLanguage();
    }
예제 #14
0
    /// <summary>
    /// ゲーム終了とシーン切り替え
    /// </summary>
    public void QuitGame()
    {
        SwitchPause(true);
        isGameOver = true;

        SaveDataManager.Save();

        GoToMenu();
    }
예제 #15
0
    private void SaveData()
    {
        if (ProgressData == null)
        {
            ProgressData = new PlayerProgressData();
        }

        SaveDataManager.Save(ProgressData, ProgressData.DirectoryPath, ProgressData.FileNamePath);
    }
예제 #16
0
    public void SaveAll()
    {
        // Simple Save to a file (without encryption)
        SaveDataManager.Save(floatNumber, "float_file");

        // Saving while encrypting
        SaveDataManager.Save(boolean, "boolean_file", "passwordHere");

        // Save of a list of a custom class without encryption
        SaveDataManager.Save(listOfDummyClasses, "listOfDummyClasses_file", "");
    }
예제 #17
0
 //SPENDING
 public bool SpendGold(int amount)
 {
     if (SaveDataManager.getValue.currentGold >= amount)
     {
         SaveDataManager.getValue.currentGold -= amount;
         SaveDataManager.Save();
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #18
0
        public override void Load()
        {
            Instance  = this;
            ModLogger = Instance.Logger;

            // Initialize all the things!
            AssetManager.Load();
            LocalizationInitializer.Initialize();
            ILManager.Load();
            SaveDataManager.Load();
            SaveDataManager.Save();
            ChangelogData.PopulateChangelogList(this);
        }
예제 #19
0
        public void Touch()
        {
            var touchedOrb = GetComponent <OrbData>();

            scoreManager.AddScore(touchedOrb.GetScore());
            orbDeleter.Delete();
            orbsManager.DeleteOrb();
            levelUpChecker.Check();
            templeScaler.Scale();
            scoreDisplayer.RefreshScoreText();
            sePlayer.SoundGetScoreSE();
            mokugyoAnimator.AnimateMokugyo();
            saveDataManager.Save();
        }
예제 #20
0
 void OnEnable()
 {
     UiObjectReferrer.instance.statisticsScrollRect.verticalNormalizedPosition = 1f;
     if (SaveDataManager.getValue.settingsLanguage == SettingsLanguages.English)
     {
         UiObjectReferrer.instance.statisticsTextMain.text = GetTextEN();
     }
     else
     {
         UiObjectReferrer.instance.statisticsTextMain.text = GetTextDE();
     }
     SaveDataManager.getValue.achieved_streber = true;
     SaveDataManager.Save();
 }
예제 #21
0
 public void reviveGold()
 {
     if (GoldScript.instance.SpendGold(revivePrice))
     {
         alreadyRevived = true;
         SceneManager.instance.callSceneRevive();
         SaveDataManager.getValue.reviveBuyedCount++;
         SaveDataManager.Save();
     }
     else
     {
         SetupLevel();
     }
 }
예제 #22
0
        public async Task UpdateMentionRoleAsync([Summary("True if you want the bot to mention / False if you don't")] bool mention)
        {
            foreach (var guildData in SaveDataManager.saveData.guildDataList)
            {
                if (guildData.guildId == Context.Guild.Id)
                {
                    guildData.useMention = mention;
                    SaveDataManager.Save();
                    await ReplyAsync("Updated settings!");

                    return;
                }
            }
            await ReplyAsync("To ensure consistency and accuracy, please first set the channel where you want the updates.");
        }
예제 #23
0
 //creates new game save
 private void NewGameSave()
 {
     //audio settings
     dataManager.SetSound(0);
     dataManager.SetMusic(0);
     dataManager.SetMaster(0);
     //visual settings
     dataManager.SetScreenOptions(1, 0);
     //gameplay settings
     dataManager.SetTowerPlacementType(true);
     dataManager.SetDifficulty(2);
     dataManager.SetDefaultMoney(defaultMoney);
     //saving process
     dataManager.Save();
 }
예제 #24
0
    public void OnGUI()
    {
        testText = GUI.TextField(new Rect(10, 10, 300, 50), testText);

        if (GUI.Button(new Rect(10, 70, 300, 100), "Save"))
        {
            customStringSavingManager.SetCustomString("Test", testText);
            saveDataManager.Save("Test");
        }

        if (GUI.Button(new Rect(10, 180, 300, 100), "Load"))
        {
            saveDataManager.Load("Test");
            testText = customStringSavingManager.GetCustomString("Test");
        }
    }
예제 #25
0
    /// <summary>
    /// ゲームの終了
    /// </summary>
    public void FinishGame()
    {
        if (isGameOver)
        {
            return;
        }

        SwitchPause(true);
        isGameOver = true;

        UIManager.instance.ToggleOverlay(true);
        UIManager.instance.ShowGameOverScreen();
        UIManager.instance.UpdateScoreTexts(new Score(traveledDistance, earnedCurrency, dealtDamage, defeatedEnemyCount));

        SaveDataManager.Save();
    }
예제 #26
0
        private void CreateNewOrb()
        {
            var generatedOrb     = orbGenerator.GenerateOrb();
            var generatedOrbData = generatedOrb.GetComponent <OrbData>();
            var orbFlyer         = generatedOrb.GetComponent <OrbFlyer>();

            scoreManager.AddScore(generatedOrbData.GetScore());
            levelUpChecker.Check();
            orbsManager.DeleteOrb();
            orbFlyer.Fly();
            scoreDisplayer.RefreshScoreText();
            sePlayer.SoundGetScoreSE();
            mokugyoAnimator.AnimateMokugyo();
            SetLastOrbGenerateTime(DateTime.UtcNow);
            saveDataManager.Save();
        }
예제 #27
0
    /// <summary>
    /// 武器箱五つの購入
    /// </summary>
    public void BuyFiveCrates()
    {
        if (GameManager.playerProfile.currecy < fiveCratesPrice)
        {
            ToggleMessageWindow(true);

            messageWindow.GetComponent <MessageWindowBehaviour>().titleText.text   = "WARNING";
            messageWindow.GetComponent <MessageWindowBehaviour>().messageText.text = "You don't have\nenough money.";

            PlayAudio(buttonClickSound);

            return;
        }
        if (InventoryManager.instance.weaponCountLimit <= InventoryManager.weapons.Count)
        {
            ToggleMessageWindow(true);

            messageWindow.GetComponent <MessageWindowBehaviour>().titleText.text   = "WARNING";
            messageWindow.GetComponent <MessageWindowBehaviour>().messageText.text = "Your inventory is full.";

            PlayAudio(buttonClickSound);

            return;
        }

        GameManager.playerProfile.currecy -= fiveCratesPrice;
        UpdateProfile();

        List <Weapon> weapons = new List <Weapon>();

        for (int count = 0; count < 5; count++)
        {
            weapons.Add(new Crate(Crate.Rank.Normal, Weapon.Grade.I).Open());
            InventoryManager.instance.AddItem(weapons[count]);
        }

        ToggleCrateWeaponStats(true);
        crateWeaponStats.GetComponent <CrateWeaponStatsBehaviour>().SetWeapons(weapons);
        crateWeaponStats.GetComponent <CrateWeaponStatsBehaviour>().ShowWeaponStats();

        SaveDataManager.Save();

        PlayAudio(purchaseSound);
    }
예제 #28
0
    //Defined Start-Routine
    IEnumerator CheckPrestartConditions()
    {
        //Check if all Saved Data is collected
        Debug.Log(LogTime.Time() + ": Game Starter Script - Loading saved Data...");
        SaveDataManager.Load();
        while (!SaveDataManager.firstDataLoaded)
        {
            yield return(new WaitForEndOfFrame());
        }
        Debug.Log(LogTime.Time() + ": Game Starter Script - All saved Data loaded...");

        //Set Language
        Debug.Log(LogTime.Time() + ": Game Starter Script - Going to apply current Language...");
        if (SaveDataManager.getValue.languageManualySet == false)
        {
            var autoLanguage = Application.systemLanguage == SystemLanguage.German ? SettingsLanguages.German : SettingsLanguages.English;
            SaveDataManager.getValue.settingsLanguage = autoLanguage;
            SaveDataManager.Save();
        }
        LanguageScript.UpdateLanguage();
        Debug.Log(LogTime.Time() + ": Game Starter Script - Language Set...");

        //Set Vibration
        VibrationManager.Setup();

        //Setup Google Play
        GoogleLoginScript.instance.CheckAutoSetup();

        //Debug && FreeShop
        if (ConstantManager.freeShop)
        {
            SaveDataManager.getValue.coinItemLVL         = 0;
            SaveDataManager.getValue.secondChanceItemLVL = 0;
            SaveDataManager.getValue.shieldItemLVL       = 0;
            SaveDataManager.getValue.shootItemLVL        = 0;
            SaveDataManager.getValue.shrinkItemLVL       = 0;
            SaveDataManager.getValue.slideItemLVL        = 0;
            SaveDataManager.Save();
        }

        //Call SceneManager to load whatever needs to be loaded
        Debug.Log(LogTime.Time() + ": Game Starter Script - Calling Scene Manager to load first Scene...");
        SceneManager.instance.startGame();
    }
예제 #29
0
 public void ButtonSpecialAds()
 {
     //Show Rewarded Ad
     if (SaveDataManager.getValue.notificationAdsFinished)
     {
         AdsManager.instance.ShowAd(AdType.Rewarded, (AdResult result) => {
             SceneManager.instance.callSceneSettings();
             if (result == AdResult.Finished)
             {
                 SaveDataManager.getValue.achieved_ehre = true;
                 SaveDataManager.Save();
             }
         });
     }
     else
     {
         SceneManager.instance.callSceneAdsNotification();
     }
 }
예제 #30
0
    /// <summary>
    /// 選択中のアイテムの売却
    /// </summary>
    public void SellItem()
    {
        if (selectedItem == null)
        {
            return;
        }
        if (selectedItem == GameManager.playerProfile.weapon)
        {
            return;
        }

        GameManager.playerProfile.currecy += ((Weapon)selectedItem).score * 10;
        if (PlayerProfile.maximumCurrencyLimit < GameManager.playerProfile.currecy)
        {
            GameManager.playerProfile.currecy = PlayerProfile.maximumCurrencyLimit;
        }

        MenuManager.instance.UpdateProfile();

        RemoveItem();

        int weaponNumber = 0;

        if (weapons.Contains((Weapon)selectedItem))
        {
            weaponNumber = weapons.IndexOf((Weapon)selectedItem);
        }

        weaponNumber--;
        if (weaponNumber < 0)
        {
            weaponNumber = weapons.Count - 1;
        }

        selectedItem = weapons[weaponNumber];
        ShowWeaponStats();

        SaveDataManager.SetClass("Player Profile", GameManager.playerProfile);
        SaveDataManager.Save();

        SetButtonStates();
    }