RaptorMesh
A RAPTOR Mesh Block.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.Components | Raptor.Components | class | preview, since 0.1.0 |
Only the per-Block modifier data members are supported API.
public sealed class RaptorMesh : MonoBehaviour, ISerializationCallbackReceiverProperties
Modifiers
public IReadOnlyList<RaptorBlockModifierData> Modifiers { get; }The modifier data entries on this Block. The list is never null; an entry is null when its type is missing. Add and remove entries with GetOrAddModifier{T} and RemoveModifier{T}.
Methods
GetModifier
public T GetModifier<T>() where T : RaptorBlockModifierDataReturns the first entry of type T, or null if there is none. Skips null entries and does not allocate.
Returns: The entry, or null.
GetOrAddModifier
public T GetOrAddModifier<T>() where T : RaptorBlockModifierData, new()Returns the entry of type T, adding one with default values if there is none. Null entries are kept and not reused. The editor records Undo around the call. Not for game code.
Returns: The entry. Never null.
RemoveModifier
public bool RemoveModifier<T>() where T : RaptorBlockModifierDataRemoves every entry of type T. Null entries are kept. The editor records Undo around the call. Not for game code.
Returns: True if an entry was removed.
Related types
- RaptorBlockModifierData: Base class for a modifier's per-Block settings, stored in RaptorMesh.Modifiers.