示例#1
0
 void Start()
 {
     //PlayerPrefs.DeleteAll();
     // Start game UI
     if (!PlayerPrefs.HasKey(DATA_GAME))
     {
         //File.WriteAllText(Application.persistentDataPath + "/" + "save.txt", "");
         PlayerPrefs.SetString(DATA_GAME, "");
         LoadingController.ShowLoading();
     }
     else
     {
         LoadDataGame();
         LoadingController.ShowLoading(true);
         PlayGameController.LoadLevelText();
     }
     Table.m_Instance.ChangeCardBack(GameControl.Instance.GetCardBack());
     HomeController.HideHome();
     MainSettingController.HideMainSetting();
     CardPackController.HideCardPack();
     BackGroundController.HideBG();
     CardFaceController.HideCardPack();
     PlayGameController.HidePlayGame();
     PopUpRateController.HidePopUpRate();
     MapController.HideMap();
 }
示例#2
0
        private void Btn_Fibonacci_Click(object sender, EventArgs e)
        {
            // Check input validity
            if (!int.TryParse(TB_Input_Fibonacci.Text, out _))
            {
                TB_Input_Fibonacci.Text = string.Empty;
                MessageBox.Show("Veuillez entrer un entier valide pour Fibonacci");
                return;
            }

            // Get Fibunacci result and display a loading dialog
            LoadingController.ShowLoading(this, ContextEnum.Fibunacci);
        }
示例#3
0
    public void ShowScene(GameSceneEnum scene)
    {
        string sceneName = scene.ToString();

        if (string.IsNullOrEmpty(sceneName))
        {
            return;
        }
        //加载Loading界面;
        if (loadingCtrl == null)
        {
            Object tempObject = ResourceMgr.Instance.LoadAssetFromAssetBundleSync(AssetType.Prefab, "Tool_Loading");
            loadingCtrl = ResourceMgr.Instance.GetAssetCtrl <LoadingController>(tempObject);
            DontDestroyOnLoad(loadingCtrl);
        }
        loadingCtrl.ShowLoading();
        if (currentScene != null)
        {
            GameObject.DestroyImmediate(currentScene);
            container.UnloadAsset();
        }
        //卸载无用资源;
        Resources.UnloadUnusedAssets();

        CoroutineMgr.Instance.StartCoroutine(ResourceMgr.Instance.LoadAssetFromAssetBundleAsync(AssetType.Prefab, sceneName,
                                                                                                go =>
        {
            if (go == null)
            {
                ShowScene(GameSceneEnum.Scene_One);
                Debug.Log(string.Format("[SceneMgr]Load Scene {0} failure!", sceneName));
                return;
            }
            currentScene = go as GameObject;
            container.AddAsset(AssetType.Prefab, sceneName);
            loadingCtrl.HideLoading();
            Debug.Log(string.Format("[SceneMgr]Load Scene {0} Success!", sceneName));
        },
                                                                                                progressValue =>
        {
            Progress = progressValue;
        }
                                                                                                ));
    }
示例#4
0
 private void Btn_XmlToJson_Click(object sender, EventArgs e)
 {
     // Get XmlToJson result and display a loading dialog
     LoadingController.ShowLoading(this, ContextEnum.XmlToJson);
 }