예제 #1
0
        public object OnGUI(string label, object value, System.Type type, out bool isDirty)
        {
            type    = wxb.IL.Help.GetRealType(type);
            isDirty = false;
            var    src = CSharpAgentSerialize.GetUnityObject(this.type, value);
            Object nv  = null;

            ObjectType.CopyFieldName(label, () =>
            {
                nv = EditorGUILayout.ObjectField($"{label}({realType.Name})", src, unityType, true);
            });
            if (nv != src)
            {
                isDirty = true;
                csharpAgentSerialize.SetObject(ref value, nv);
            }
            else
            {
                isDirty = false;
            }

            return(value);
        }
예제 #2
0
        public object OnGUI(string label, object value, System.Type type, out bool isDirty)
        {
#if USE_HOT
            if (type is ILRuntimeWrapperType)
            {
                type = ((ILRuntimeWrapperType)type).RealType;
            }
#endif
            isDirty = false;
            var src = CSharpAgentSerialize.GetUnityObject(this.type, value);
            var nv  = EditorGUILayout.ObjectField(label, src, unityType, true);
            if (nv != src)
            {
                isDirty = true;
                csharpAgentSerialize.SetObject(ref value, nv);
            }
            else
            {
                isDirty = false;
            }

            return(value);
        }