Пример #1
0
        /* inter */

        /* ctor */
        public InspectorObject(UpdatableComponentEditor editor, Dictionary <string, object> deserializeDictionary, SerializeItem serializeItem)
        {
            if (deserializeDictionary is null)
            {
                throw new ArgumentNullException(nameof(deserializeDictionary));
            }
            if (serializeItem is null)
            {
                throw new ArgumentNullException(nameof(serializeItem));
            }
            Editor = editor ?? throw new ArgumentNullException(nameof(editor));

            Name              = serializeItem.Name;
            Title             = new GUIContent(serializeItem.Title, serializeItem.ToolTip);
            Order             = serializeItem.Order;
            UseUnitySerialize = serializeItem.UseUnitySerialize;
            UseJsonSerialize  = serializeItem.UseJsonSerialize;
            ObjectType        = Type.GetType(serializeItem.TypeFullName, false);
            if (ObjectType is null &&
                !TypeDictionary.TryGetValue(serializeItem.TypeFullName, out ObjectType))
            {
                Debug.LogError($"Not found type : {serializeItem.TypeFullName}");
            }

            deserializeDictionary.TryGetValue(Name, out OldValue);
            NewValue = OldValue;
        }
Пример #2
0
        /* inter */

        /* ctor */
        public InspectorMethod(UpdatableComponentEditor editor, MarkingMethod markingMethod)
        {
            if (editor is null)
            {
                throw new ArgumentNullException(nameof(editor));
            }
            if (markingMethod is null)
            {
                throw new ArgumentNullException(nameof(markingMethod));
            }
            Editor = editor ?? throw new ArgumentNullException(nameof(editor));

            Name            = markingMethod.Name;
            Title           = new GUIContent(markingMethod.Title);
            IsEditorAction  = markingMethod.IsEditorAction;
            IsRuntimeAction = markingMethod.IsRuntimeAction;
        }