public VisitedReferencesScope(InspectorContext inspectorContext, ref TValue value, PropertyPath path) { _mInspectorContext = inspectorContext; m_ReferenceType = !RuntimeTypeInfoCache <TValue> .IsValueType; if (m_ReferenceType) { if (EqualityComparer <TValue> .Default.Equals(value, default)) { m_Object = null; VisitedOnCurrentBranch = false; return; } m_ReferenceType = !value.GetType().IsValueType; } if (m_ReferenceType) { m_Object = value; VisitedOnCurrentBranch = !_mInspectorContext.PushReference(value, path); } else { m_Object = null; VisitedOnCurrentBranch = false; } }
bool VisitEnum <TContainer, TValue>( InspectorContext inspectorContext, IProperty <TContainer> property, ref TValue value, PropertyPath path, bool isWrapper) { var inspector = GetCustomInspector(property, ref value, path, isWrapper); if (null == inspector) { if (RuntimeTypeInfoCache <TValue> .IsEnumFlags) { GuiFactory.FlagsField(property, ref value, path, inspectorContext); } else { GuiFactory.EnumField(property, ref value, path, inspectorContext); } } else { using (inspectorContext.MakeIgnoreInspectorScope()) { var customInspector = new CustomInspectorElement(path, inspector, inspectorContext.Root); inspectorContext.Parent.contentContainer.Add(customInspector); } } return(true); }
public PathOverrideScope(InspectorContext context, PropertyPath path) { m_Context = context; m_Path = context.CopyCurrentPath(); m_Context.ClearPath(); m_Context.AddToPath(path); }
bool VisitNull <TContainer, TValue>(InspectorContext inspectorContext, IProperty <TContainer> property, ref TValue value, PropertyPath path) { var element = new NullElement <TValue>(inspectorContext.Root, property, path); inspectorContext.Parent.contentContainer.Add(element); return(true); }
bool IInspectorContravariantVisit <UnityEngine.Object> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, Object value, PropertyPath path) { if (property.HasAttribute <InlineUnityObjectAttribute>() || (inspectorContext.IsRootObject && inspectorContext.Root is InspectorElement)) { return(false); } PrimitiveVisit(inspectorContext, property, ref value, path, ObjectFieldFactory); return(true); }
bool PrimitiveVisit <TValue, TElement>( InspectorContext inspectorContext, IProperty property, ref TValue value, PropertyPath path, FactoryHandler <TValue, TElement> handler) { var inspector = GetAttributeDrawer(property, ref value, path); if (null == inspector) { handler(property, ref value, path, inspectorContext); } else { using (inspectorContext.MakeIgnoreInspectorScope()) { var customInspector = new CustomInspectorElement(path, inspector, inspectorContext.Root); inspectorContext.Parent.contentContainer.Add(customInspector); } } return(true); }
bool IInspectorVisit <bool> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref bool value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, ToggleFactory);
bool IInspectorVisit <double> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref double value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, DoubleFieldFactory);
bool IInspectorVisit <ulong> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref ulong value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, ULongFieldFactory);
bool IInspectorVisit <ushort> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref ushort value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, UShortFieldFactory);
bool IInspectorVisit <sbyte> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref sbyte value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, SByteFieldFactory);
bool IInspectorVisit <float> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref float value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, FloatFieldFactory);
bool IInspectorVisit <char> .Visit <TContainer>( InspectorContext inspectorContext, IProperty <TContainer> property, ref char value, PropertyPath path) => PrimitiveVisit(inspectorContext, property, ref value, path, CharFieldFactory);
public PathScope(InspectorContext context, IProperty property) { m_Context = context; m_Property = property; m_Context.AddToPath(m_Property); }
public IgnoreInspectorScope(InspectorContext inspectorContext) { m_Context = inspectorContext; ++m_Context.m_IgnoreNextInspectorsCount; }
public ParentScope(InspectorContext inspectorContext, VisualElement parent) { m_Context = inspectorContext; m_Parent = parent; m_Context.PushParent(m_Parent); }