示例#1
0
        public static bool enter_Inspect(this IPEGI var, ref bool entered)
        {
            var lst = var as IPEGI_ListInspect;

            return(lst != null?lst.enter_Inspect_AsList(ref entered) :
                       var.GetNameForInspector().enter_Inspect(var, ref entered));
        }
示例#2
0
        public static bool enter_Inspect(this string txt, IPEGI var, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null)
        {
            var changed = false;

            txt.TryAddCount(var).enter(ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);//)

            return((ef.isFoldedOutOrEntered && var.Nested_Inspect()) || changed);
        }
示例#3
0
        public static bool enter_Inspect(this string label, IPEGI val, ref int inspected, int current)
        {
            if (label.enter(ref inspected, current))
            {
                return(val.Inspect());
            }

            return(false);
        }
示例#4
0
        public static bool enter_Inspect(this string txt, IPEGI var, ref bool entered, bool showLabelIfTrue = true)
        {
            var changed = false;

            //if (
            txt.TryAddCount(var).enter(ref entered, showLabelIfTrue); //)
                                                                      // var.Try_NameInspect().changes(ref changed);

            return((ef.isFoldedOutOrEntered && var.Nested_Inspect()) || changed);
        }
示例#5
0
        public static bool enter_Inspect(this icon ico, string txt, IPEGI var, ref int enteredOne, int thisOne, bool showLabelIfTrue = true)
        {
            var changed = false;

            var il = IndentLevel;

            ico.enter(txt.TryAddCount(var), ref enteredOne, thisOne, showLabelIfTrue).nl_ifNotEntered();//)

            IndentLevel = il;

            return((ef.isFoldedOutOrEntered && var.Nested_Inspect()) || changed);
        }
                public void Render(IPEGI target, WindowFunction doWindow, string c_windowName)
                {
                    ef.ResetInspectionTarget(target);

                    _function = doWindow;

                    if (UseWindow)
                    {
                        _windowRect.x = Mathf.Clamp(_windowRect.x, 0, Screen.width - 10);
                        _windowRect.y = Mathf.Clamp(_windowRect.y, 0, Screen.height - 10);

                        _windowRect = GUILayout.Window(0, _windowRect, DrawFunctionWrapper, c_windowName,
                                                       GUILayout.MaxWidth(360 * upscale), GUILayout.ExpandWidth(true));
                    }
                    else
                    {
                        DrawFunctionWrapper(0);
                    }
                }
示例#7
0
        public static bool Try_Nested_Inspect(GameObject go, Component cmp = null)
        {
            var changed = false;

            IPEGI pgi = null;

            if (cmp)
            {
                pgi = cmp as IPEGI;
            }

            if (pgi == null)
            {
                pgi = go.GetComponent <IPEGI>();
            }

            if (pgi != null)
            {
                pgi.Nested_Inspect().RestoreBGColor().changes(ref changed);
            }
            else
            {
                var mbs = go.GetComponents <Component>();

                foreach (var m in mbs)
                {
                    TryDefaultInspect(m).changes(ref changed);
                }
            }

            nl();
            UnIndent();

            if (changed)
            {
                go.SetToDirty();
            }

            return(changed);
        }
 public void Render(IPEGI p, string windowName) => Render(p, p.Inspect, windowName);
 public void Render(IPEGI p) => Render(p, p.Inspect, p.GetNameForInspector());
示例#10
0
        public static bool conditional_enter_inspect(this string label, bool canEnter, IPEGI obj, ref bool entered)
        {
            if (label.TryAddCount(obj).conditional_enter(canEnter, ref entered))
            {
                return(obj.Nested_Inspect());
            }

            ef.isFoldedOutOrEntered = entered;

            return(false);
        }