RaptorBlockEdits
Inspector helpers for checking editability, finding owning models and editing in one undo step.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Lets an Inspector block anchored to a component's section edit the selection the same way the built-in sections do.
public static class RaptorBlockEditsProperties
ManipulationActive
public static bool ManipulationActive { get; }Whether a Scene view manipulation, such as a handle drag, is in progress. Edits wait until it ends.
Methods
CanEdit
public static bool CanEdit(Component[] targets)Returns whether every target can be edited from the Inspector now. Returns false in Play mode, or when a target is generated output, read-only, owned by a dedicated authoring tool, or of a different geometry kind from the current mode.
| Parameter | Type | Description |
|---|---|---|
targets | Component[] | The components. |
Returns: True when every target can be edited.
OwningModels
public static RaptorModel[] OwningModels(IEnumerable<Component> components)Returns the distinct RAPTOR models that own components (the nearest RaptorModel parent of each).
| Parameter | Type | Description |
|---|---|---|
components | IEnumerable<Component> | The components. |
Returns: The models.
Transaction
public static bool Transaction(Object[] touched, RaptorModel[] models, string undoName, Action write)Runs write as one undo step named undoName. Records touched, runs the write, rebuilds every model in models, marks changed objects dirty (recording prefab overrides) and collapses the step. If write throws, the step is reverted and the exception is rethrown.
| Parameter | Type | Description |
|---|---|---|
touched | Object[] | The objects the write changes. |
models | RaptorModel[] | The models to rebuild. |
undoName | string | The undo step's name. |
write | Action | The edit to run. |
Returns: Always true.
Related types
- RaptorModel: The root of a RAPTOR model and its output container.