Vixen
02b45cc4
csharp
public sealed class InspectorField

One member bound to the objects being inspected, with the inspector's own vocabulary on top.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A drawer is handed one of these and nothing else. It is what makes a drawer's job "turn a value into controls and controls back into a value" rather than "and also find the undo stack, and also handle the case where twenty objects are selected, and also decide whether the reset button is shown".

Read, write, mixed, undo and the refresh guard are EditProperty's, which is the pipeline every editing surface in the editor writes through — doc 36 § D1. A drawer therefore gets exactly what a scene-view tool or a plugin's panel gets, and the four things below are what an inspector adds to it: a type's defaults to reset to, a prefab to revert to, a condition that decides who an edit reaches, and the typed Member the generated metadata hangs off.

Fields and properties (10)

  • public InspectorDescriptor Descriptor

    The type the whole selection has in common.

  • public IPrefabSource? Prefab

    What the objects were made from, for revert-to-prefab.

  • public InspectorMember Member

    The member being edited, with everything the generator recorded about it.

  • public override bool CanWrite

    Whether this member will be written at all.

  • protected override IReadOnlyList<object> Reached

    Which of Objects a write actually reaches.

  • public bool IsModified

    Whether the member differs from what a fresh instance of the type has.

  • public bool CanReset

    Whether there is a default to put back.

  • public bool IsOverridden

    Whether any target overrides this member against the prefab it came from.

  • public bool IsVisible

    Whether the member is shown at all, given its condition.

  • public IReadOnlyList<object> WritableTargets

    The targets whose condition is satisfied, which are the ones an edit reaches.

Methods (3)

  • public InspectorField(InspectorDescriptor descriptor, InspectorMember member, IReadOnlyList<object> targets, EditorDocument? document = null, IPrefabSource? prefab = null)

    Binds a member to a selection.

  • public bool Reset()

    Puts the member back to what a fresh instance of the type has.

  • public bool RevertToPrefab()

    Puts the member back to the prefab's value, per object.

Used by (43, showing 40)

  • AssetDrawerVixen.Editor.Inspector
  • AssetFieldDropVixen.Editor.App
  • AssetPickerVixen.Editor.App
  • AssetPickerTestsVixen.Editor.App.Tests
  • BehaviorAuthoringTestsVixen.Editor.App.Tests
  • BooleanDrawerVixen.Editor.Inspector
  • BrushInspectorMarkupTestsVixen.Editor.Terrain.Tests
  • Color3DrawerVixen.Editor.Inspector
  • ColorDrawerVixen.Editor.Inspector
  • ComponentDrawerVixen.Editor.Inspector
  • ComponentTestsVixen.Editor.App.Tests
  • ComponentsViewVixen.Editor.App
  • CompositeTestsVixen.Editor.Inspector.Tests
  • CurveDrawerVixen.Editor.Inspector
  • DrawerTestsVixen.Editor.Inspector.Tests
  • DropIntoFieldTestsVixen.Editor.App.Tests
  • EditingTestsVixen.Editor.Inspector.Tests
  • EditorAffordanceTestsVixen.Editor.App.Tests
  • EnumDrawerVixen.Editor.Inspector
  • IPropertyDrawerVixen.Editor.Inspector
  • InspectorFixtureVixen.Editor.Inspector.Tests
  • InspectorPanelTestsVixen.Editor.App.Tests
  • InspectorRowVixen.Editor.Inspector
  • InspectorRowsVixen.Editor.Inspector
  • InspectorTargetVixen.Editor.Inspector
  • InspectorViewVixen.Editor.Inspector
  • ListDrawerVixen.Editor.Inspector
  • MarkupBindingTestsVixen.Editor.Inspector.Tests
  • MultilineDrawerVixen.Editor.Inspector
  • NestedDrawerVixen.Editor.Inspector
  • NumberDrawerVixen.Editor.Inspector
  • OneEditPathTestsVixen.Editor.App.Tests
  • OptionalDrawerVixen.Editor.Inspector
  • OverrideCellVixen.Editor.AssetEditors
  • PanelTestsVixen.Editor.Inspector.Tests
  • PropertyClipboardVixen.Editor.Inspector
  • PropertyDrawerVixen.Editor.Inspector
  • PropertyFieldVixen.Editor.Inspector
  • ReadOnlyDrawerVixen.Editor.Inspector
  • ScenarioTestsVixen.Editor.App.Tests