Vixen
02b45cc4
csharp
public sealed class PropertyClipboard

The one value copy-property put there, and what it will paste into.

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

Remarks

The type is carried with the value, and paste checks it. The interesting case is copying a Vector3 position and pasting it into a Vector3 scale, which is a thing people do on purpose and which works. Pasting a float into an int is refused rather than truncated, because a silent conversion is how a rotation ends up quantised to whole degrees with nothing said.

Deliberately not the system clipboard. A property value is not text, round-tripping it through one would need a serialisation format that means something outside this process, and the operation people want is "put this number on that other object" — which never leaves the editor. Copying a property's value as text is a different command and belongs to the platform layer.

Fields and properties (5)

  • public static PropertyClipboard Default

    The clipboard the inspector uses unless it is handed another.

  • public object? Value

    What was copied, if anything.

  • public Type? ValueType

    What type it was copied from.

  • public string? SourceName

    Where it came from, for the menu item's label.

  • public bool HasValue

    Whether anything has been copied.

Methods (4)

  • public bool Copy(InspectorField field)

    Takes a copy of a field's value.

  • public bool CanPaste(InspectorField field)

    Whether what is on the clipboard would go into a field.

  • public bool Paste(InspectorField field)

    Writes what was copied into a field.

  • public void Clear()

    Forgets what was copied.

Used by (3)

  • EditingTestsVixen.Editor.Inspector.Tests
  • InspectorViewVixen.Editor.Inspector
  • PanelTestsVixen.Editor.Inspector.Tests