Class SerializedRead

Namespace
SurvivorsMaker.Editor
Assembly
SurvivorsMaker.Editor.dll

Null-tolerant reads of serialized definition data by field name. Missing or mistyped fields fall back to the given default, so editor UI keeps working while authoring assets gain or rename fields.

public static class SerializedRead
Inheritance
SerializedRead
Inherited Members

Methods

Bool(SerializedProperty, string, bool)

public static bool Bool(SerializedProperty parent, string name, bool fallback)

Parameters

parent SerializedProperty
name string
fallback bool

Returns

bool

Child(SerializedProperty, string)

public static SerializedProperty Child(SerializedProperty parent, string name)

Parameters

parent SerializedProperty
name string

Returns

SerializedProperty

Condition(SerializedProperty)

public static TriggerCondition Condition(SerializedProperty p)

Parameters

p SerializedProperty

Returns

TriggerCondition

Elements(SerializedProperty)

Elements of a serialized array, or an empty list when the array is missing.

public static List<SerializedProperty> Elements(SerializedProperty array)

Parameters

array SerializedProperty

Returns

List<SerializedProperty>

Elite(SerializedObject)

public static EliteDef Elite(SerializedObject asset)

Parameters

asset SerializedObject

Returns

EliteDef

Elite(SerializedProperty)

Reads an elite from an EliteDef property or from an elite asset's root iterator (same field names).

public static EliteDef Elite(SerializedProperty p)

Parameters

p SerializedProperty

Returns

EliteDef

Enum<T>(SerializedProperty, string, T)

public static T Enum<T>(SerializedProperty parent, string name, T fallback) where T : struct, Enum

Parameters

parent SerializedProperty
name string
fallback T

Returns

T

Type Parameters

T

Float(SerializedProperty, string, float)

public static float Float(SerializedProperty parent, string name, float fallback)

Parameters

parent SerializedProperty
name string
fallback float

Returns

float

HasRulePayload(TriggerDef)

True when any rule field differs from its default (the payload a rules toggle would activate).

public static bool HasRulePayload(TriggerDef d)

Parameters

d TriggerDef

Returns

bool

Hit(SerializedProperty)

public static HitEffectDef Hit(SerializedProperty p)

Parameters

p SerializedProperty

Returns

HitEffectDef

Int(SerializedProperty, string, int)

public static int Int(SerializedProperty parent, string name, int fallback)

Parameters

parent SerializedProperty
name string
fallback int

Returns

int

Mixed(SerializedProperty, string)

True when the named child is missing or differs across the selected objects.

public static bool Mixed(SerializedProperty parent, string name)

Parameters

parent SerializedProperty
name string

Returns

bool

Modifier(SerializedProperty)

public static EliteModifier Modifier(SerializedProperty p)

Parameters

p SerializedProperty

Returns

EliteModifier

ReferenceName(SerializedProperty)

Display name for an id-backed object reference, e.g. an enemy asset in a spawn entry.

public static string ReferenceName(SerializedProperty reference)

Parameters

reference SerializedProperty

Returns

string

RootBool(SerializedObject, string, bool)

public static bool RootBool(SerializedObject asset, string name, bool fallback)

Parameters

asset SerializedObject
name string
fallback bool

Returns

bool

RootFloat(SerializedObject, string, float)

public static float RootFloat(SerializedObject asset, string name, float fallback)

Parameters

asset SerializedObject
name string
fallback float

Returns

float

Status(SerializedProperty)

public static StatusEffectDef Status(SerializedProperty p)

Parameters

p SerializedProperty

Returns

StatusEffectDef

String(SerializedProperty, string, string)

public static string String(SerializedProperty parent, string name, string fallback = "")

Parameters

parent SerializedProperty
name string
fallback string

Returns

string

Trigger(SerializedProperty)

public static TriggerDef Trigger(SerializedProperty p)

Parameters

p SerializedProperty

Returns

TriggerDef

Unlock(SerializedProperty)

public static UnlockDef Unlock(SerializedProperty p)

Parameters

p SerializedProperty

Returns

UnlockDef