Exemple #1
0
 public void UnlockHealth(E_HealthLevel heatlh)
 {
     if ((E_HealthLevel)PlayerPrefs.GetInt("Health ", (int)E_HealthLevel.One) < heatlh)
     {
         PlayerPrefs.SetInt("Health ", (int)heatlh);
     }
 }
Exemple #2
0
    public void Save_Load()
    {
        CurrentLevel         = PlayerPrefs.GetString(GameType + "Level", "level01");
        CurrentGameZone      = PlayerPrefs.GetInt(GameType + "GameZone", 0);
        CurrentSurvivalRound = PlayerPrefs.GetInt(GameType + "SurvivalRound", 0);
        GameDifficulty       = (E_GameDifficulty)PlayerPrefs.GetInt(GameType + "Difficulty", 0);

        Money       = PlayerPrefs.GetInt(GameType + "Money", 0);
        SwordLevel  = (E_SwordLevel)PlayerPrefs.GetInt(GameType + "Sword", 0);
        HealthLevel = (E_HealthLevel)PlayerPrefs.GetInt(GameType + "Health", 0);

        for (int i = 0; i < ComboLevel.Length; i++)
        {
            ComboLevel[i] = (E_ComboLevel)PlayerPrefs.GetInt(GameType + "Combo" + i, 0);
        }
    }
Exemple #3
0
    public void StartSurvivalMode()
    {
        ClearInstances();
        _GameType = E_GameType.Survival;

        ClearStatistics();
        Save_Clear();
        Save_Load();

        GameDifficulty = E_GameDifficulty.Hard;

        ComboLevel  = new E_ComboLevel[] { GetUnlockedCombo(0), GetUnlockedCombo(1), GetUnlockedCombo(2), GetUnlockedCombo(3), GetUnlockedCombo(4), GetUnlockedCombo(5) };
        SwordLevel  = GetUnlockedSword();
        HealthLevel = GetUnlockedHealth();

        _CurrentLevel = "dojo";

        Application.LoadLevel(CurrentLevel);
    }
Exemple #4
0
    public void StartChapterMode(int index)
    {
        string[] chapters = { "level01", "level01b", "level02", "level03", "level05", "level06", "level07" };
        ClearInstances();

        _GameType = E_GameType.ChapterOnly;

        Save_Clear();
        Save_Load();
        ClearStatistics();

        GameDifficulty = E_GameDifficulty.Hard;
        CurrentLevel   = chapters[index];

        ComboLevel  = new E_ComboLevel[] { GetUnlockedCombo(0), GetUnlockedCombo(1), GetUnlockedCombo(2), GetUnlockedCombo(3), GetUnlockedCombo(4), GetUnlockedCombo(5) };
        SwordLevel  = GetUnlockedSword();
        HealthLevel = GetUnlockedHealth();

        Application.LoadLevel(CurrentLevel);
    }
Exemple #5
0
    public void BuyHealthLevel()
    {
        Money -= (int)PriceHealth[(int)HealthLevel];

        if (HealthLevel == E_HealthLevel.One)
        {
            HealthLevel = E_HealthLevel.Two;
        }
        else if (HealthLevel == E_HealthLevel.Two)
        {
            HealthLevel = E_HealthLevel.Three;
        }

        if (GameType == E_GameType.SinglePlayer)
        {
            UnlockHealth(HealthLevel);
        }

        GuiManager.Instance.SetHealthPercent(Player.Instance.Agent.BlackBoard.Health, Player.Instance.Agent.BlackBoard.RealMaxHealth);

        AudioSource.PlayClipAtPoint(SoundDataManager.Instance.ShopBuyHealth, Camera.main.transform.position);
    }
Exemple #6
0
    IEnumerator _Show()
    {
        GuiManager.FadeOut(0.2f, 0.7f);

        yield return(new WaitForSeconds(0.3f));

        //Debug.Log("Show shop");

        if (Game.Instance.GameType != E_GameType.Survival)
        {
            DefaultSpriteUI.ShowSprite(GuiShopBackgroundTop.Instance.Sprite);
            DefaultSpriteUI.ShowSprite(GuiShopBackgroundMiddle.Instance.Sprite);
            DefaultSpriteUI.ShowSprite(GuiShopBackgroundBottom.Instance.Sprite);

            DefaultSpriteUI.ShowSprite(GuiShopBackgroundTopTop.Instance.Sprite);
            DefaultSpriteUI.ShowSprite(GuiShopBackgroundTopMiddle.Instance.Sprite);
            DefaultSpriteUI.ShowSprite(GuiShopBackgroundTopBottom.Instance.Sprite);
        }

        DefaultSpriteUI.ShowSprite(GuiShopBackgroundMiddleTop.Instance.Sprite);
        DefaultSpriteUI.ShowSprite(GuiShopBackgroundMiddleMiddle.Instance.Sprite);
        DefaultSpriteUI.ShowSprite(GuiShopBackgroundMiddleBottom.Instance.Sprite);

        DefaultSpriteUI.ShowSprite(GuiShopBackgroundDownTop.Instance.Sprite);
        DefaultSpriteUI.ShowSprite(GuiShopBackgroundDownMiddle.Instance.Sprite);
        DefaultSpriteUI.ShowSprite(GuiShopBackgroundDownBottom.Instance.Sprite);

        if (Game.Instance.GameType != E_GameType.Survival)
        {
            DefaultSpriteUI.ShowSprite(GuiShopKarmaCaption.Instance.Sprite);
        }

        DefaultSpriteUI.ShowSprite(GuiShopComboCaption.Instance.Sprite);

        DefaultSpriteUI.ShowSprite(GuiShopButtonOk.Instance.Sprite);
        DefaultSpriteUI.ShowSprite(GuiShopButtonBack.Instance.Sprite);

        if (Game.Instance.GameType != E_GameType.Survival)
        {
            ButtonHealth.Show();
            ButtonSword.Show();
        }

        for (int i = 0; i < ButtonCombo.Length; i++)
        {
            ButtonCombo[i].Show();
        }

        if (Game.Instance.GameType != E_GameType.Survival)
        {
            GuiManager.ShowNumbers(Karma, Game.Instance.Money, 99999);
        }

        SaveExperience  = Game.Instance.Money;
        SaveSwordLevel  = Game.Instance.SwordLevel;
        SaveHealthlevel = Game.Instance.HealthLevel;
        for (int i = 0; i < 6; i++)
        {
            SaveComboLevels[i] = Game.Instance.ComboLevel[i];
        }

        Time.timeScale = 0;

        Game.Instance.GameState = E_GameState.Shop;
    }