Exemplo n.º 1
0
        static LabelRightFunc DispatchLabelRightFunc(Type type)
        {
            LabelRightFunc ret = null;

            if (TypeUtility.IsList(type))
            {
                ret = ListLabelRightFunc;
            }

            return(ret);
        }
Exemplo n.º 2
0
        static object DoField(object obj, Type type, string label, GUIStyle style, FieldFunc fieldFunc, LabelRightFunc labelRightFunc, GUILayoutOption[] options)
        {
            using (new GUILayout.VerticalScope(style, options))
            {
                GUILayout.BeginHorizontal();

                obj = PrefixLabelDraggable(label, obj, type, out var isLong);

                if (isLong || labelRightFunc != null)
                {
                    if (labelRightFunc != null)
                    {
                        obj = labelRightFunc(obj, type);
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(PrefixLabelSetting.width + GUI.skin.label.margin.horizontal);
                }

                obj = fieldFunc(obj, type);

                GUILayout.EndHorizontal();
            }

            return(obj);
        }