Ejemplo n.º 1
0
    public void Retry()
    {
        if (SettingManager.Instance.TotalTili < 1)
        {
            NotEnoughTiliDialog.Popup();
            return;
        }

        if (SettingManager.Instance.TotalTili == 20)
        {
            SettingManager.Instance.TiliRecoverTime = System.DateTime.Now.ToString();
//			MainArea.Instance.StartRecoverTili();
        }
        GameData.Instance.AddTili(-1);
        GameData.Instance.goldDouble     = false;
        GameData.Instance.bulletCapacity = 1f;

        Time.timeScale                = 1.2f;
        GameData.Instance.Pause       = false;
        GameData.Instance.CurrentWave = 0;
        if (GameData.Instance.LevelType == LevelType.RushLevel)
        {
            GameData.Instance.GotoLevel(GameData.Instance.CurrentLevel);
        }
        DialogManager.Instance.CloseDialog();
        Camera.main.GetComponent <GrayscaleEffect>().enabled = false;
//		GameData.Instance.LevelType = LevelType.RushLevel;


        if (GameData.Instance.LevelType == LevelType.RushLevel)
        {
            SettingManager.Instance.AdvantageModeTime += 1;
            SettingManager.Instance.UseTiliNum        += 1;
            Ultilities.CleanMemory();
            Application.LoadLevel(Application.loadedLevelName);
        }
        else
        {
            GameData.Instance.Reset();
            SettingManager.Instance.ChallegeModeTime += 1;
            SettingManager.Instance.UseTiliNum       += 1;
            Ultilities.CleanMemory();
            Application.LoadLevel(Application.loadedLevelName);
        }

        SettingManager.Instance.TutorialRetry = 0;
    }
Ejemplo n.º 2
0
    public void DirectPass()
    {
        if (SettingManager.Instance.TotalDiamond < 50)
        {
            NotEnoughDiamondDialog.Popup();
            return;
        }

        if (SettingManager.Instance.TotalTili < 1)
        {
            NotEnoughTiliDialog.Popup();
            return;
        }

        GameData.Instance.AddDiamond(-50);
        MTAManager.DoEvent(MTAPoint.MINI_BUY_DIR_PASS);
        SettingManager.Instance.NextLevel += 1;
        GotoNextLevel();
    }
Ejemplo n.º 3
0
    public void onEnterFight()
    {
        if (SettingManager.Instance.TotalTili < 1)
        {
            NotEnoughTiliDialog.Popup();
            return;
        }

        Time.timeScale = 1.2f;

        if (SettingManager.Instance.TotalTili == 20)
        {
            SettingManager.Instance.TiliRecoverTime = System.DateTime.Now.ToString();
            //			MainArea.Instance.StartRecoverTili();
        }
        GameData.Instance.AddTili(-1);

        GameData.Instance.CurrentWave = 0;
        if (s_name.Contains("wujin"))
        {
            SettingManager.Instance.ChallegeModeTime += 1;
            SettingManager.Instance.UseTiliNum       += 1;
            GameData.Instance.LevelType = LevelType.InfiniteLevel;
            int r = Random.Range(0, 2);
#if US_VERSION
            if (r == 0)
            {
                LoadingScene.Load("wujin_us");
            }
            else if (r == 1)
            {
                LoadingScene.Load("wujin02_us");
            }
#else
            if (r == 0)
            {
                LoadingScene.Load("wujin");
            }
            else if (r == 1)
            {
                LoadingScene.Load("wujin02");
            }
#endif
            //			else if (r == 2)
            //				LoadingScene.Load("wujin03");
        }
        else if (s_name.Contains("changjing"))
        {
            SettingManager.Instance.AdvantageModeTime += 1;
            SettingManager.Instance.UseTiliNum        += 1;
            //			int r = Random.Range(0, 2);
            GameData.Instance.LevelType = LevelType.RushLevel;
#if US_VERSION
            if (SettingManager.Instance.SceneSelection == 1)
            {
                LoadingScene.Load("changjing01_us");
            }
            else if (SettingManager.Instance.SceneSelection == 2)
            {
                LoadingScene.Load("changjing02_us");
            }
#else
            if (SettingManager.Instance.SceneSelection == 1)
            {
                LoadingScene.Load("changjing01");
            }
            else if (SettingManager.Instance.SceneSelection == 2)
            {
                LoadingScene.Load("changjing02");
            }
#endif
        }
    }