Exemplo n.º 1
0
        protected override void OnGUI()
        {
            base.OnGUI();

            if (!m_Scanned)
            {
                EditorGUILayout.HelpBox(k_Instructions, MessageType.Info);
                GUIUtility.ExitGUI();
            }

            if (m_SceneRoots.Count == 0)
            {
                GUILayout.Label(k_NoMissingReferences);
            }
            else
            {
                using (var scrollView = new GUILayout.ScrollViewScope(m_ScrollPosition))
                {
                    m_ScrollPosition = scrollView.scrollPosition;
                    foreach (var kvp in m_SceneRoots)
                    {
                        kvp.Value.Draw();
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void ShowDialogue()
 {
     if (curShow == null)
     {
         ShowNotification(new GUIContent("请选择一组对白开始查看"));
     }
     else
     {
         RemoveNotification();
         GUILayout.Label("正在演示 " + curShow.Id + ":" + curShow.Desc);
         using (var sc = new GUILayout.ScrollViewScope(scPos, "box"))
         {
             for (int i = 0; i <= curShow.curIndex; ++i)
             {
                 var dia = curShow.dialogues[i];
                 if (dia.dialogueType == DialogueType.Narrator_旁白)
                 {
                     GUILayout.Label(GUILayoutTools.GetTextSizeOf(dia.ShowText(), 13));
                 }
                 else
                 {
                     GUILayout.Label(GUILayoutTools.GetTextSizeOf(string.Format("【{0}】: {1}", GetCharacterName(dia.characterId), dia.content), 13));
                 }
                 GUILayout.Space(10);
             }
             scPos = sc.scrollPosition;
         }
     }
 }
Exemplo n.º 3
0
            public void DoGUIWindow()
            {
                GUI.ModalWindow(PopupWindowId, GetWindowRect(), (id) =>
                {
                    using (var sc = new GUILayout.ScrollViewScope(scrollPosition))
                    {
                        scrollPosition = sc.scrollPosition;

                        for (var j = 0; j < displayOptions.Length; ++j)
                        {
                            if (GUILayout.Button(displayOptions[j], RGUIStyle.popupFlatButton))
                            {
                                result = j;
                            }
                        }
                    }

                    var ev = Event.current;
                    if ((ev.rawType == EventType.MouseDown) && !(new Rect(Vector2.zero, size).Contains(ev.mousePosition)))
                    {
                        result = -1;;
                    }
                }
                                , label, RGUIStyle.popup);
            }
        private void OnGUI()
        {
            LoadResources();

            if (!_isAnimator)
            {
                return;
            }

            if (_developmentAnimatorItem.developmentController == null)
            {
                const string btnCaption = "Create a Development Animator";
                if (GUILayout.Button(new GUIContent(btnCaption), GUILayout.MinHeight(50f)))
                {
                    CreateDevelopmentController(_developmentAnimatorItem.originalController);
                    LoadResources();
                }
                return;
            }

            DrawHeaderToolbar();
            DrawSearchBar();

            using (var scrollView = new GUILayout.ScrollViewScope(_scrollPos, false, false))
            {
                _scrollPos = scrollView.scrollPosition;

                DrawClipsList();
            }
        }
        private void RegisteredListenersList()
        {
            using (GUILayout.HorizontalScope h = new GUILayout.HorizontalScope("ToolbarButton"))
            {
                GUILayout.Label("Registered Listeners");
            }

            if (!Application.isPlaying)
            {
                using (GUILayout.VerticalScope v = new GUILayout.VerticalScope(GameEventStyles.Box, GUILayout.Height(21)))
                    GUILayout.Label("All GameEventListeners registered to this event. Populated at runtime.");
            }
            else
            {
                using (GUILayout.ScrollViewScope s = new GUILayout.ScrollViewScope(_listenersScrollPosition, GameEventStyles.Box))
                {
                    _listenersScrollPosition = s.scrollPosition;

                    if (_listeners.Count == 0)
                    {
                        GUILayout.Label("No GameEventListeners are registered to this event.");
                    }

                    for (int i = 0; i < _listeners.Count; i++)
                    {
                        GUIStyle style = i % 2 == 0 ? GameEventStyles.ListBackgroundEven : GameEventStyles.ListBackgroundOdd;
                        if (GUILayout.Button(_listeners[i].gameObject.name, style))
                        {
                            Selection.activeObject = _listeners[i];
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void OnGUI()
        {
            if (null == Registry)
            {
                return;
            }

            var module = Module.Dereference(Registry);

            using (var scroll = new GUILayout.ScrollViewScope(m_Scroll, UTinyStyles.ListBackground))
            {
                m_Scroll = scroll.scrollPosition;

                foreach (var reference in module.GetSystemExecutionOrder())
                {
                    var system = reference.Dereference(Registry);

                    using (new GUIColorScope(system != null ? Color.white : Color.red))
                        using (new GUILayout.HorizontalScope(UTinyStyles.ListBackground))
                        {
                            using (new GUIEnabledScope(system.Enabled))
                            {
                                GUILayout.Label(system?.Name ?? reference.Name, EditorStyles.boldLabel, GUILayout.Height(16));
                            }
                        }
                }
            }
        }
Exemplo n.º 7
0
 private void ShowDebugWindow()
 {
     GUI.Box(rectDebugLogBackground, GUIContent.none, guiSkin.customStyles[0]);
     GUILayout.Space(24f);
     using (var areaScope = new GUILayout.AreaScope(rectDebugLogScroll))
     {
         using (var scrollScope = new GUILayout.ScrollViewScope(scrollDebugPosition, guiSkin.scrollView))
         {
             scrollScope.handleScrollWheel = true;
             scrollDebugPosition = scrollScope.scrollPosition;
             for (indexDebug = 0; indexDebug < log.Count; indexDebug++)
             {
                 if (indexDebug > logCapacity)
                     break;
                 GUILayout.Label(log[indexDebug], guiSkin.label);
             }
         }
     }
     if (GUI.Button(rectDebugButtonClear, "Clear", guiSkin.button))
     {
         ClearLogs();
     }
     if (GUI.Button(rectDebugButtonFontInc, "A+", guiSkin.button))
     {
         if (guiSkin.label.fontSize < 64)
             guiSkin.label.fontSize += 2;
     }
     if (GUI.Button(rectDebugButtonFontDesc, "A-", guiSkin.button))
     {
         if (guiSkin.label.fontSize > 8)
             guiSkin.label.fontSize -= 2;
     }
 }
        public void OnGUI()
        {
            using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(scrollPosition))
            {
                scrollPosition = scrollViewScope.scrollPosition;
                GUILayout.Label(windowTitle, EditorStyles.boldLabel);

                prefabTypeIndex = EditorGUILayout.Popup(prefabTypeIndex, prefabTypes);

                if (GUILayout.Button(buttonText))
                {
                    switch (prefabTypeIndex)
                    {
                    case 0:
                        ProcessSelectedGameObjects <LinearJointDrive>(linearJointPrefab);
                        break;

                    case 1:
                        ProcessSelectedGameObjects <LinearTransformDrive>(linearTransformPrefab);
                        break;

                    case 2:
                        ProcessSelectedGameObjects <AngularJointDrive>(angularJointPrefab);
                        break;

                    case 3:
                        ProcessSelectedGameObjects <AngularTransformDrive>(angularTransformPrefab);
                        break;
                    }
                }
            }
        }
Exemplo n.º 9
0
    void OnGUI()
    {
        so.Update();

        using (var scroll = new GUILayout.ScrollViewScope(scrollPos, false, false)) {
            scrollPos = scroll.scrollPosition;
            using (ShapesUI.Group)
                GUILayout.Label("Mouseover any setting label for more info", EditorStyles.centeredGreyMiniLabel);

            void Space() => GUILayout.Space(10);

            CsharpConfigSettings();
            Space();
            RenderPipeSettings();
            Space();
            PrimitiveSettings();
            Space();
            ShaderSettings();
            Space();
            AdvancedSettings();
        }

        so.ApplyModifiedProperties();

        if (Event.current.type == EventType.MouseDown && Event.current.button == 0)
        {
            GUI.FocusControl("");
            Repaint();
        }
    }
Exemplo n.º 10
0
    private void DrawSettingsWindow()
    {
        // Draw the settings window.

        DrawBackButton();                                                                               // Draw the back button to be able to go back to the main window.

        var scrollControlID = GUIUtility.GetControlID(FocusType.Passive);                               // Add Scrolling to the window
        var scrollState     = GetScrollState(scrollControlID);

        using (var scrollView = new GUILayout.ScrollViewScope(scrollState.scrollPosition))              // Scrolling section of the window.
        {
            scrollState.scrollPosition = scrollView.scrollPosition;

            switch (selected)                                                                           // Using the selected int data member, determine which buffer was slected and draw their own interface settings
            {
            case 0:
                m_buffer.DrawSettingScreen();
                break;

            case 1:
                m_aoBufferSettings.DrawSettingScreen();
                break;

            case 2:
                m_phoneBufferSettings.DrawSettingScreen();
                break;
            }

            GUILayout.FlexibleSpace();
        }
    }
Exemplo n.º 11
0
        private void OnGUI()
        {
            LoadResources();

            searchText = SearchUtils.BeginSearchbar(this, searchText);
            if (SearchUtils.Button(new GUIContent("Remove All"), GUILayout.MaxWidth(CLEAR_BUTTON_WIDTH)))
            {
                list.Clear();

                Repaint();
            }
            SearchUtils.EndSearchbar();

            using (var scrollView = new GUILayout.ScrollViewScope(scrollPos, false, false))
            {
                scrollPos = scrollView.scrollPosition;

                for (int i = list.References.Count - 1; i >= 0; i--)
                {
                    var reference = list.References[i];

                    if (SearchUtils.IsSearched(reference, searchText))
                    {
                        if (DrawElement(reference))
                        {
                            list.RemoveReference(reference);
                        }
                    }
                }

                list.References.RemoveAll(reference => reference == null);
            }

            DetectDragNDrop();
        }
    public void OnGUI()
    {
        this.wantsMouseMove = true;
        if (!IsShowing(id))
        {
            this.Close();
            return;
        }

        // Show Scrollview
        using (new GUIUtil.SkinScope(dropdownskin))
            using (var scroll = new GUILayout.ScrollViewScope(scrollPos, false, false, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
            {
                scrollPos = scroll.scrollPosition;
                for (int i = 0; i < Elements.Count; i++)
                {
                    if (GUILayout.Button(Elements[i]))
                    {
                        if (OnOptionSelected != null)
                        {
                            OnOptionSelected(i, Elements[i]);
                        }
                        GUI.FocusControl(null);
                        s_showing[id] = false;
                        this.Close();
                        break;
                    }
                }
            }
        this.Repaint();
    }
Exemplo n.º 13
0
        private void RenderTabMonoBehaviour()
        {
            using (new GUILayout.VerticalScope("Box"))
            {
                if (selectedMonoBehaviour)
                {
                    using (GUILayout.ScrollViewScope scroll = new GUILayout.ScrollViewScope(monoBehaviourScrollPos))
                    {
                        monoBehaviourScrollPos = scroll.scrollPosition;
                        RenderToggleButtons($"MonoBehaviour: {selectedMonoBehaviour.GetType().Name}");

                        using (new GUILayout.VerticalScope("Box"))
                        {
                            GUILayout.Label("Fields", "header");
                            RenderAllMonoBehaviourFields(selectedMonoBehaviour);
                            GUILayout.Label("Methods", "header");
                            RenderAllMonoBehaviourMethods(selectedMonoBehaviour);
                        }
                    }
                }
                else
                {
                    GUILayout.Label($"No selected MonoBehaviour\nClick on an object in '{GetTab("MonoBehaviour").Get().Name}'", "fillMessage");
                }
            }
        }
        private void OnGUI()
        {
            if (AssetBundles.mainManifest == null)
            {
                GUILayout.Label("no loaded AssetBundleManifest");
                return;
            }

            if (GUILayout.Button("UnloadUnused"))
            {
                AssetBundles.UnloadUnused(true);
            }

            using (new GUILayout.HorizontalScope())
            {
                using (var sv = new GUILayout.ScrollViewScope(scrollPos, "box", GUILayout.MaxWidth(Screen.width * 0.4f)))
                {
                    scrollPos = sv.scrollPosition;
                    foreach (var abInfo in AssetBundles.mainManifest.AssetBundleInfos.OrderBy(o => o.Name))
                    {
                        DrawAssetBundle(abInfo);
                    }
                }

                using (var sv = new GUILayout.ScrollViewScope(scrollPos2, "box", GUILayout.MaxWidth(Screen.width * 0.6f)))
                {
                    scrollPos2 = sv.scrollPosition;

                    DrawDetails(selectedAssetBundleInfo);
                }
            }
        }
Exemplo n.º 15
0
        private void OnGUI()
        {
            if (!isShow)
            {
                return;
            }

            using (var sv = new GUILayout.ScrollViewScope(this.scrollPosition)) {
                using (new GUILayout.HorizontalScope(GUI.skin.box)) {
                    this.scrollPosition = sv.scrollPosition;

                    using (new GUILayout.VerticalScope(GUILayout.Width(100))) {
                        Util.ForEach(this.monos, (name, mono) => {
                            if (GUILayout.Button(name))
                            {
                                this.current = mono;
                            }
                        });
                    }
                    using (new GUILayout.VerticalScope(GUILayout.Width(Screen.width - 150))) {
                        if (this.current)
                        {
                            this.current.OnDebug();
                        }
                    }
                }
            }
        }
Exemplo n.º 16
0
        public override void OnGUI(Rect rect)
        {
            GUILayout.BeginVertical("box");
            using (var sc = new GUILayout.ScrollViewScope(scorllPos))
            {
                EditorTools.DrawTitle("Preferences");
                GUILayout.BeginVertical("box");
                Prefs.timeStepMode = (Prefs.TimeStepMode)EditorGUILayout.EnumPopup("Time Step Mode", Prefs.timeStepMode);
                if (Prefs.timeStepMode == Prefs.TimeStepMode.Seconds)
                {
                    Prefs.snapInterval = EditorTools.CleanPopup <float>("Working Snap Interval", Prefs.snapInterval, Prefs.snapIntervals.ToList());
                }
                else
                {
                    Prefs.frameRate = EditorTools.CleanPopup <int>("Working Frame Rate", Prefs.frameRate, Prefs.frameRates.ToList());
                }
                GUILayout.EndVertical();

                GUILayout.BeginVertical("box");
                Prefs.clipBasicColor   = EditorGUILayout.ColorField("Clip的基础色", Prefs.clipBasicColor);
                Prefs.scrollWheelZooms = EditorGUILayout.Toggle("Scroll Wheel Zooms", Prefs.scrollWheelZooms);
                if (onDraw != null)
                {
                    onDraw.Invoke();
                }
                GUILayout.EndVertical();
                scorllPos = sc.scrollPosition;
            }
            GUILayout.EndVertical();
        }
Exemplo n.º 17
0
        void OnGUI()
        {
            using (var sv = new GUILayout.ScrollViewScope(scroll))
            {
                scroll = sv.scrollPosition;

                using (new HorizontalCenteredScope())
                {
                    using (new GUILayout.VerticalScope(GUILayout.Width(390)))
                    {
                        if (BlockoutStaticFunctions.FindHeirachy(ref hierarchy))
                        {
                            renderingSplash = false;
                            DrawMainWindow();
                        }
                        else
                        {
                            renderingSplash = true;
                            splashScreen.DrawSection();
                        }
                    }
                }
            }

            if (sections.Count(x => x.Repaint) > 0)
            {
                Repaint();
            }
        }
Exemplo n.º 18
0
        public void OnGUI()
        {
            selectedObject = Selection.activeGameObject;

            using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(scrollPosition))
            {
                scrollPosition = scrollViewScope.scrollPosition;
                GUILayout.Label("Generate New Multi-Part Component", EditorStyles.boldLabel);

                componentName  = EditorGUILayout.TextField("Container Name", componentName);
                selectedOption = (OptionType)EditorGUILayout.EnumPopup("Component Type", selectedOption);

                if (selectedObject != null)
                {
                    string nestLabel = string.Format("Generate in [{0}]", selectedObject.name);
                    nestInSelectedObject = EditorGUILayout.Toggle(new GUIContent(nestLabel, nestLabel), nestInSelectedObject);
                }

                EditorHelper.DrawHorizontalLine();

                if (GUILayout.Button("Generate Component"))
                {
                    CreateComponent(selectedOption);
                }
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// 描画
        /// </summary>
        private void Draw()
        {
            using (new GUILayout.HorizontalScope(GUILayout.Width(Screen.width)))
            {
                //色の変更
                GUI.color = backGroundColor;

                //横に並べる
                using (new GUILayout.HorizontalScope(GUILayout.Width((Screen.width / 4) * canvasSize)))
                {
                    using (new GUILayout.ScrollViewScope(gridScrollPosition, GUI.skin.box))
                    {
                        DrawGrid(mapSize);
                    }
                }
                GUI.color = Color.white;

                //画面の4分の1から、バーのサイズ(8px)分引いている
                using (var scrollView = new GUILayout.ScrollViewScope(palletScrollPosition, GUILayout.Width((Screen.width / 4) - 8)))
                {
                    palletScrollPosition = scrollView.scrollPosition;
                    pallet.ToggleView();
                }
            }
        }
Exemplo n.º 20
0
    void OnGUI()
    {
        using (var scrollRectLayout = new GUILayout.ScrollViewScope(classSroll))
        {
            classSroll = scrollRectLayout.scrollPosition;
            if (DrawHeader("MissComponent"))
            {
                foreach (MissRef m in missComp)
                {
                    if (GUILayout.Button(m.o.name))
                    {
                        Selection.activeObject = m.o;
                    }
                }
            }

            if (DrawHeader("MissRef"))
            {
                foreach (MissRef m in missRef)
                {
                    if (m.o == null)
                    {
                        continue;
                    }
                    if (GUILayout.Button(m.o.name))
                    {
                        Selection.activeObject = m.o;
                    }
                }
            }
        }
    }
Exemplo n.º 21
0
        void OnGUI()
        {
            ShowTokenSettingUI();
            EditorGUILayout.Space();

            if (!IsLoggedIn)
            {
                return;
            }

            dataStore.AccessToken = VerifiedToken;
            selectVenue.Process();
            editAndUploadView.Process();
            previewVenueView.Process();

            using (var scrollViewScope = new GUILayout.ScrollViewScope(scrollPosition))
            {
                scrollPosition = scrollViewScope.scrollPosition;
                selectVenue.DrawUI(this);
                editAndUploadView.DrawUI(this);

                GUILayout.FlexibleSpace();
            }

            previewVenueView.DrawUI();
        }
Exemplo n.º 22
0
            protected override void DrawItem()
            {
                using (var scroll = new GUILayout.ScrollViewScope(scrollPos))
                {
                    scrollPos = scroll.scrollPosition;
                    using (var vertical = new GUILayout.VerticalScope())
                    {
                        var grouped = groupedPopupDataGeneric.GroupBy(m => m.group);

                        foreach (var item in grouped)
                        {
                            if (!string.IsNullOrEmpty(searchString))
                            {
                                if (searchString.ToLower().Contains("g:"))
                                {
                                    var s = searchString.ToLower().Split(':');
                                    if (!item.Key.ToLower().Contains(s.Last().ToLower()))
                                    {
                                        continue;
                                    }
                                }
                            }
                            string label = string.IsNullOrEmpty(item.Key) ? " Ungrouped" : " " + item.Key;
                            GUILayout.Label(label, GroupHeader);
                            foreach (var child in item)
                            {
                                if (!string.IsNullOrEmpty(searchString))
                                {
                                    if (!searchString.ToLower().Contains("g:"))
                                    {
                                        if (!child.item.ToString().ToLower().Contains(searchString.ToLower()))
                                        {
                                            continue;
                                        }
                                    }
                                }
                                var contetn = new GUIContent(child.item.ToString());
                                if (CurrentGeneric != null)
                                {
                                    if (CurrentGeneric.item.Equals(child.item))
                                    {
                                        contetn.image = EditorGUIUtility.FindTexture("d_P4_CheckOutRemote");
                                    }
                                }
                                if (GUILayout.Button(contetn, ItemStyle))
                                {
                                    OnSelectGeneric?.Invoke(child);
                                    editorWindow.Close();
                                }
                                Rect btnRect = GUILayoutUtility.GetLastRect();
                                if (btnRect.Contains(Event.current.mousePosition))
                                {
                                    //GUI.Box(btnRect, "", new GUIStyle("U2D.createRect"));
                                    editorWindow.Repaint();
                                }
                            }
                        }
                    }
                }
            }
Exemplo n.º 23
0
        void OnGUI()
        {
            using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(m_ScrollPosition))
            {
                m_ScrollPosition = scrollViewScope.scrollPosition;

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Space(5f);

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Space(10f);

                        m_ImportFontParametersSection.DrawInspector();
                        GUILayout.Space(5f);
                        m_ImportCustomFontSection.DrawInspector();
                        GUILayout.Space(5f);
                        m_ImportWebFontSection.DrawInspector();
                    }

                    GUILayout.Space(5f);
                }
            }
        }
Exemplo n.º 24
0
        void OnGUI()
        {
            if (Event.current.isKey) // If we detect the user pressed the keyboard
            {
                EditorGUI.FocusTextInControl("SearchInputField");
            }

            if (Event.current.type == EventType.KeyDown)
            {
                KeyCode keyCode = Event.current.keyCode;
                if (keyCode != KeyCode.Return)
                {
                    if (keyCode == KeyCode.Escape)
                    {
                        base.Close();
                        GUIUtility.ExitGUI();
                        return;
                    }

                    if (keyCode == KeyCode.PageDown)
                    {
                        MovePageDown();
                        Repaint();
                        return;
                    }
                    else if (keyCode == KeyCode.PageUp)
                    {
                        MovePageUp();
                        Repaint();
                        return;
                    }
                }
                else
                {
                    Close();
                    GUIUtility.ExitGUI();
                    return;
                }
            }

            using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(m_ScrollPosition))
            {
                m_ScrollPosition = scrollViewScope.scrollPosition;

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Space(5f);

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Space(10f);
                        DrawSearchTextField();
                        DrawPicker();
                    }

                    GUILayout.Space(5f);
                }
            }
        }
 void DrawScrollViewModify()
 {
     using (var scrollViewScope = new GUILayout.ScrollViewScope(scrollPositionModified))
     {
         scrollPositionModified = scrollViewScope.scrollPosition;
         reorderableListViewModify.DoLayoutList();
     }
 }
Exemplo n.º 26
0
 public void OnGUI()
 {
     using (var scroll = new GUILayout.ScrollViewScope(scrollPosition))
     {
         scrollPosition = scroll.scrollPosition;
         LoggedEvents.DrawGUI();
     }
 }
Exemplo n.º 27
0
    private void DrawCustomFoldout()
    {
        // Method that draws the custom foldout section using the list and a switch using each properties type.
        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
        foldout2 = DrawFoldout(foldout2, "Custom");                                                                             // Draw the foldout for custom.
        if (foldout2)
        {
            var scrollControlID = GUIUtility.GetControlID(FocusType.Passive);                               // Add Scrolling to the window
            var scrollState     = GetScrollState(scrollControlID);

            using (var scrollView = new GUILayout.ScrollViewScope(scrollState.scrollPosition))              // Scrolling section of the window.
            {
                scrollState.scrollPosition = scrollView.scrollPosition;

                for (int i = 0; i < list.Count; i++)                                                                                 // Loop througbht the list of Property Objects
                {
                    EditorGUILayout.BeginHorizontal();
                    switch (list[i].type)                                                                                          // Switch on the type for each Property. Depending on the type, different methods are called to draw the sections.
                    {
                    case (int)PROPERTY_TYPE.FloatField:
                        list[i].value = DrawFloatField((float)list[i].value, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.IntegerField:
                        list[i].value = DrawIntField((int)list[i].value, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.StringField:
                        list[i].value = DrawTextField((string)list[i].value, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.FloatSlider:
                        list[i].value = DrawFloatSlider((float)list[i].value, list[i].minValue, list[i].maxValue, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.IntegerSlider:
                        list[i].value = DrawIntSlider((int)list[i].value, list[i].minValue, list[i].maxValue, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.MaterialField:
                        DrawMaterialField(null, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.LightField:
                        DrawLightField(null, list[i].name, 20);
                        break;

                    case (int)PROPERTY_TYPE.BooleanField:
                        list[i].value = DrawToggle((bool)list[i].value, list[i].name, 20);
                        break;
                    }
                    DrawCloseButton(i);
                    EditorGUILayout.EndHorizontal();
                }
            }
        }
        EditorGUILayout.EndVertical();
    }
Exemplo n.º 28
0
    private void OnGUI()
    {
        using (new GUILayout.VerticalScope("box"))
        {
            using (new GUILayout.HorizontalScope("box"))
            {
                // Stack visualization
                using (var stackScope = new GUILayout.ScrollViewScope(stackScroll, "box", GUILayout.Width(Screen.width / 3), GUILayout.Height(2 * Screen.height / 3)))
                {
                    stackScroll = stackScope.scrollPosition;
                    for (int i = 0; i < context.stack.Count; i++)
                    {
                        if (context.stack[i] == null)
                        {
                            GUILayout.Label("NULL");
                        }
                        else
                        {
                            GUILayout.Label(context.stack[i].ToString());
                        }
                    }
                }

                // Instruction visualization
                using (var instScope = new GUILayout.ScrollViewScope(instScroll, "box", GUILayout.Width(Screen.width / 3), GUILayout.Height(2 * Screen.height / 3)))
                {
                    instScroll = instScope.scrollPosition;
                    for (int i = 0; i < script.instructions.Count; i++)
                    {
                        GUILayout.Label(i + ": " + script.instructions[i].ToString());
                    }
                }
            }

            using (new GUILayout.HorizontalScope("box"))
            {
                if (GUILayout.Button(">", GUILayout.Width(50), GUILayout.Height(50)))
                {
                    script.Step(context);
                }

                if (GUILayout.Button(">>", GUILayout.Width(50), GUILayout.Height(50)))
                {
                    running = !running;
                }

                if (GUILayout.Button("<<", GUILayout.Width(50), GUILayout.Height(50)))
                {
                    context = new NCSContext(script, script.file);
                    script.lastInstruction = null;
                }
                if (script.lastInstruction != null)
                {
                    GUILayout.Label("Last instruction (" + context.programCounter + "): " + script.lastInstruction.ToString());
                }
            }
        }
    }
Exemplo n.º 29
0
 private void OnGUI()
 {
     using (var scroll = new GUILayout.ScrollViewScope(m_ScrollPosition))
     {
         m_ScrollPosition = scroll.scrollPosition;
         OnGUICustomProperties();
         OnGUIButtons();
     }
 }
Exemplo n.º 30
0
 void OnGUI()
 {
     using (var scroll = new GUILayout.ScrollViewScope(scorllPos, false, true))
     {
         DrawBrush();
         DrawEditorInfo();
         scorllPos = scroll.scrollPosition;
     }
 }