コード例 #1
0
    public void GotoNextLevel()
    {
//		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.GotoLevel(GameData.Instance.CurrentLevel + 1);
        DialogManager.Instance.CloseDialog();
        Camera.main.GetComponent <GrayscaleEffect>().enabled = false;
        GameData.Instance.LevelType = LevelType.RushLevel;
        GameData.Instance.Pause     = false;

        GameData.Instance.goldDouble     = false;
        GameData.Instance.bulletCapacity = 1f;
        Ultilities.CleanMemory();

        OtherDialog.Popup(Application.loadedLevelName);
//		Application.LoadLevel(Application.loadedLevelName);
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (!EscPressed && Input.GetKeyUp(KeyCode.Escape))
        {
            string currentLevelName = Application.loadedLevelName;

            if (currentLevelName.Contains(CHANGJING) || currentLevelName.Contains(WUJIN))
            {
                Time.timeScale          = 0;
                GameData.Instance.Pause = true;
//				DialogManager.Instance.PopupDialog(CommonAsset.Load("prefabs/Dialogs/PauseGameDialog"));
                PauseGameDialog.Popup();
            }
            else if (currentLevelName.Contains(UI))
            {
                Ultilities.CleanMemory();
                Application.LoadLevel("login");
            }
            else if (currentLevelName.Contains("chuanggan"))
            {
                Ultilities.CleanMemory();
                Application.LoadLevel("ui");
            }
            else if (currentLevelName.Contains("login"))
            {
                ExitGameDialog.Popup();
            }


            EscPressed = true;
        }
    }
コード例 #3
0
    public void GotoLevelMenu()
    {
        Ultilities.CleanMemory();
#if US_VERSION
        Application.LoadLevel("chuanggan02_us");
#else
        Application.LoadLevel("chuanggan02");
#endif
    }
コード例 #4
0
    public void LoadUIScene()
    {
        Ultilities.CleanMemory();
#if US_VERSION
        Application.LoadLevel("ui_us");
#else
        Application.LoadLevel("ui");
#endif
    }
コード例 #5
0
    // Use this for initialization
    IEnumerator Start()
    {
        Debug.Log("level name " + levelName);
        yield return(new WaitForSeconds(1));

        Ultilities.CleanMemory();
        yield return(Application.LoadLevelAsync(levelName));

        yield return(new WaitForSeconds(1));
    }
コード例 #6
0
    void OnLeaveBattle()
    {
        Time.timeScale          = 1.2f;
        GameData.Instance.Pause = false;
        DialogManager.Instance.CloseDialog();
        GameData.Instance.goldDouble             = false;
        GameData.Instance.bulletCapacity         = 1f;
        GameData.Instance.daojuDiamondAdditional = false;
        if (SettingManager.Instance.DiamondJiacheng == 1)
        {
            SettingManager.Instance.DiamondJiacheng = 2;
        }
//		WeaponManager.selectedWeapons.Clear();
        Ultilities.CleanMemory();
        Application.LoadLevel("ui");
    }
コード例 #7
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;
    }