コード例 #1
0
ファイル: QuickDeployWindow.cs プロジェクト: tionyufa/Running
        /// <summary>
        /// Displays a save dialog, saves the specified path to config, and then creates a loading scene at that path.
        /// </summary>
        private void HandleCreateLoadingSceneButton()
        {
            if (string.IsNullOrEmpty(Config.AssetBundleUrl))
            {
                DialogHelper.DisplayMessage(LoadingScreenCreationErrorTitle,
                                            "AssetBundle URL text field cannot be null or empty.");
                return;
            }

            string saveFilePath =
                DialogHelper.SaveFilePanelInProject("Create Loading Scene", Config.LoadingSceneFileName, "unity");

            if (String.IsNullOrEmpty(saveFilePath))
            {
                // Assume cancelled.
                return;
            }

            Config.LoadingSceneFileName = saveFilePath;

            try
            {
                Config.SaveConfiguration(true);
                LoadingScreenGenerator.GenerateScene(Config.AssetBundleUrl, Config.LoadingBackgroundImage,
                                                     saveFilePath);

                // Select the Loading screen element in the generated scene, so the user can see the assetBundle url
                // field in the inspector.
                Selection.SetActiveObjectWithContext(LoadingScreenGenerator.CurrentLoadingScreen, null);
                Close();
            }
            catch (Exception ex)
            {
                DialogHelper.DisplayMessage(LoadingScreenCreationErrorTitle, ex.Message);
                throw;
            }
        }
コード例 #2
0
 // Visible for testing.
 public static Texture2D FindLoadingTileTexture()
 {
     return(LoadingScreenGenerator.FindAssetByFilter <Texture2D>("GooglePlayInstantLoadingTile t:texture2d"));
 }