Пример #1
0
        public override void OnFlowToolsMenuGUI(string prefix, GenericMenu menu)
        {
            menu.AddSeparator(prefix);

                        #if WEBPLAYER
            menu.AddDisabledItem(new GUIContent("Compile UI..."));
                        #else
            menu.AddItem(new GUIContent(prefix + "Compile UI Wizard..."), on: false, func: () => {
                Compiler.ShowEditor(null, null);
            });
            menu.AddItem(new GUIContent(prefix + "Compile UI"), on: false, func: () => {
                CompilerSystem.currentNamespace = FlowSystem.GetData().namespaceName;
                CompilerSystem.Generate(AssetDatabase.GetAssetPath(FlowSystem.GetData()), recompile: true, minimalScriptsSize: false);
            });
                        #endif
        }
Пример #2
0
        public override void OnFlowToolbarGUI(GUIStyle buttonStyle)
        {
            base.OnFlowToolbarGUI(buttonStyle);

            if (FlowSystem.IsCompileDirty() == true)
            {
                var color = GUI.color;

                GUI.color = Color.red;
                if (GUILayout.Button("Recompile", buttonStyle) == true)
                {
                    CompilerSystem.currentNamespace = FlowSystem.GetData().namespaceName;
                    CompilerSystem.Generate(AssetDatabase.GetAssetPath(FlowSystem.GetData()), recompile: true, minimalScriptsSize: false);
                }

                GUI.color = color;
            }
        }
Пример #3
0
        private void DrawBottom()
        {
            GUILayout.FlexibleSpace();

            CustomGUI.Splitter();

            GUILayout.BeginHorizontal();
            {
                var firstPart = (this.partIndex == 0);
                var lastPart  = (this.partIndex >= this.parts - 2);

                var oldEnabled = GUI.enabled;

                GUI.enabled = !lastPart;
                if (GUILayout.Button("Cancel", this.defaultSkin.button, GUILayout.Width(100f), GUILayout.Height(30f)) == true)
                {
                    this.Close();
                }

                GUILayout.FlexibleSpace();

                GUI.enabled = oldEnabled && !firstPart && !lastPart;
                if (GUILayout.Button("Back", this.defaultSkin.button, GUILayout.Width(100f), GUILayout.Height(30f)) == true)
                {
                    --this.partIndex;
                }
                GUI.enabled = oldEnabled;

                GUI.enabled = GUI.enabled && this.readyToNext;
                if (this.partIndex == this.processPartIndex)
                {
                    if (GUILayout.Button("GO!", this.defaultSkin.button, GUILayout.Width(100f), GUILayout.Height(30f)) == true)
                    {
                        ++this.partIndex;
                        this.Repaint();

                        if (this.saveDefaultSettings == true)
                        {
                            FlowSystem.GetData().namespaceName      = this.compileNamespace;
                            FlowSystem.GetData().forceRecompile     = this.forceRecompile;
                            FlowSystem.GetData().minimalScriptsSize = this.minimalScriptsSize;
                            FlowSystem.SetDirty();
                        }

                        CompilerSystem.currentNamespace = this.compileNamespace;

                        if (this.tagsIgnored.Count == 0)
                        {
                            // Build all

                            CompilerSystem.Generate(AssetDatabase.GetAssetPath(FlowSystem.GetData()), this.forceRecompile, this.minimalScriptsSize);
                        }
                        else
                        {
                            var tags = new List <int>();
                            foreach (var tag in FlowSystem.GetData().tags)
                            {
                                if (this.tagsIgnored.Contains(tag.id) == false)
                                {
                                    tags.Add(tag.id);
                                }
                            }

                            CompilerSystem.GenerateByTags(AssetDatabase.GetAssetPath(FlowSystem.GetData()), tags.ToArray(), this.forceRecompile, this.minimalScriptsSize);
                        }

                        this.Repaint();
                    }
                }
                else
                {
                    if (lastPart == true)
                    {
                        if (this.onComplete != null)
                        {
                            this.onComplete();
                        }
                        this.onComplete = null;

                        if (GUILayout.Button("Finish", this.defaultSkin.button, GUILayout.Width(100f), GUILayout.Height(30f)) == true)
                        {
                            this.Close();
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("Next", this.defaultSkin.button, GUILayout.Width(100f), GUILayout.Height(30f)) == true)
                        {
                            ++this.partIndex;
                        }
                    }
                }
                GUI.enabled = oldEnabled;
            }
            GUILayout.EndHorizontal();
        }