コード例 #1
0
        private void RenderSettings()
        {
            GUIStyle guistyle = new GUIStyle(GUI.skin.label);

            guistyle.richText = true;
            EditorGUILayout.Space();
            GUILayout.Label(new GUIContent("2. Select a folder that contains your assets", "You should select one folder that contains all the assets that you want to include to the package."), new GUILayoutOption[0]);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            bool enabled = GUI.enabled;

            if (this.m_Package == null || this.m_Package.Status != Package.PublishedStatus.Draft || this.m_AssetsState != AssetStorePackageController.AssetsState.None)
            {
                GUI.enabled = false;
            }
            if (GUILayout.Button("Select...", new GUILayoutOption[]
            {
                GUILayout.Width(90f)
            }))
            {
                this.ChangeRootPathDialog();
            }
            GUI.enabled = enabled;
            this.RenderAssetsFolderStatus();
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();
            GUILayout.Label(new GUIContent("3. Tick the box if your content uses \"Package Manager\" dependencies", "If your assets package has dependencies on \"Package Manager\" packages (e.g. \"Ads\", \"TextMesh Pro\", \"Shader Graph\", or others), tick this checkbox to include those dependencies."), guistyle, new GUILayoutOption[0]);
            bool includePackageManagerDependencies = this.m_IncludePackageManagerDependencies;

            this.m_IncludePackageManagerDependencies = GUILayout.Toggle(this.m_IncludePackageManagerDependencies, "Include dependencies", new GUILayoutOption[0]);
            if (includePackageManagerDependencies != this.m_IncludePackageManagerDependencies)
            {
                this.m_UnsavedChanges = true;
            }
            EditorGUILayout.Space();
            GUILayout.Label(new GUIContent("4. Validate Package <i>(Optional)</i>", "Click 'Validate' to check if your package meets the basic package validation criteria. Keep in mind that passing this validation does not guarantee that your package will be accepted."), guistyle, new GUILayoutOption[0]);
            if (GUILayout.Button("Validate", new GUILayoutOption[]
            {
                GUILayout.Width(80f)
            }))
            {
                ValidatorWindow andShowWindow = ValidatorWindow.GetAndShowWindow();
                andShowWindow.PackagePath = "Assets" + this.m_LocalRootPath;
            }
            EditorGUILayout.Space();
        }
コード例 #2
0
ファイル: App.cs プロジェクト: Nuclearistt/TEKLauncher
 private void ExitHandler(object Sender, ExitEventArgs Args)
 {
     MWindow?.SettingsPage?.SteamDownloader?.Pause();
     MWindow?.ModInstallerPage?.Downloader?.Pause();
     foreach (ValidatorWindow ValidatorWindow in Windows.OfType <ValidatorWindow>())
     {
         ValidatorWindow.Shutdown = true;
         ValidatorWindow.Close();
     }
     foreach (ModsFixerWindow ModsFixerWindow in Windows.OfType <ModsFixerWindow>())
     {
         ModsFixerWindow.Shutdown = true;
         ModsFixerWindow.Close();
     }
     PipeServer?.Close();
     Disconnect();
     Close();
     Retract();
     SaveList();
     Settings.Save();
     Environment.Exit(0);
 }
コード例 #3
0
        private void Show(StratusEpisode episode)
        {
            GUILayout.Label(episode.label, EditorStyles.whiteLargeLabel);
            //StratusEditorUtility.OnLastControlMouseClick(null, null, () => { Selection.activeGameObject = episode.gameObject; });

            EditorGUILayout.BeginHorizontal();
            StratusEditorUtility.ModifyProperty(episode, "mode", GUIContent.none);
            if (GUILayout.Button("Validate", EditorStyles.miniButtonRight))
            {
                ValidatorWindow.Open("Episode Validation", ObjectValidation.Aggregate(episode));
            }
            EditorGUILayout.EndHorizontal();

            foreach (var segment in episode.segments)
            {
                if (segment == null || !segmentExpanded.ContainsKey(segment))
                {
                    continue;
                }

                // Show the segment
                GUILayout.BeginHorizontal(EditorStyles.toolbar);
                //episode.initialSegment == episode ? $"{episode.label} *" : episode.label, EditorStyles.whiteLabel
                GUIStyle segmentStyle = EditorStyles.label; // segment == (episode.initialSegment) ? EditorStyles.centeredGreyMiniLabel: GUI.skin.label;
                string   label        = episode.initialSegment == segment ? $"{segment.label} (Initial)" : segment.label;
                segmentExpanded[segment] = EditorGUILayout.Foldout(segmentExpanded[segment], label, false, EditorStyles.foldout);

                //if (EditorGUI.Rect)
                System.Action onRightClick = () =>
                {
                    var menu = new GenericMenu();
                    menu.AddItem(new GUIContent("Select"), false, () => { Selection.activeGameObject = segment.gameObject; });
                    if (!Application.isPlaying)
                    {
                        menu.AddItem(new GUIContent("Set Initial"), false, () => { episode.SetInitialSegment(segment); });
                    }
                    else
                    {
                        menu.AddItem(new GUIContent("Enter"), false, () =>
                        {
                            episode.Enter(segment, true, 0);
                        });
                    }
                    menu.ShowAsContext();
                };

                System.Action onDoubleClick = () =>
                {
                    StratusDebug.Log("Boop");
                    Selection.activeGameObject = segment.gameObject;
                };

                StratusEditorUtility.OnLastControlMouseClick(null, onRightClick, onDoubleClick);

                //var button = new GUIObject();
                //button.label = segment.label;
                //button.onRightClickDown = onRightClick;
                //button.onLeftClickUp = onLeftClick;
                //button.Draw(segmentStyle);


                GUILayout.EndHorizontal();

                ShowSegment(episode, segment);
            }
        }