Game.Effects.SourceUpdateType
Assembly:
Assembly-CSharp (game assembly)
Namespace: Game.Effects
Type: public enum
Base: System.Enum
Summary: SourceUpdateType is an enumeration used by the effects system to indicate what kind of update is being applied to an effect source. Each value represents a semantic operation or state change for a source (for example: adding a source, a temporary spawn, snapping/instant update, removing a source, or an error state when the prefab is incorrect). This enum is intended to be used by effect producers/consumers and update handlers to branch logic according to the intended update type.
Fields
-
Add
A normal/permanent addition of an effect source. Use this when a source should be created and kept until explicitly removed. -
Temp
A temporary or short-lived source. Use this for transient effects that should expire automatically after a short duration or after a single update. -
Snap
An immediate/instant update typically used to snap a source to a new position/state. Useful when an instantaneous reposition or state correction is required rather than a continuous interpolated update. -
Remove
Indicates the source should be removed/cleaned up. Handlers should stop the effect and release any associated resources. -
WrongPrefab
Indicates an error condition: the provided prefab is not valid for this source type (mismatch). Handlers can use this to log, ignore, or attempt fallback behavior.
Properties
- None (enum provides no custom properties) The enum type itself has no custom properties. Standard System.Enum members and methods (ToString, GetHashCode, etc.) apply.
Constructors
- None (enum values are static members) Enums do not expose public constructors. Values are the named constants defined above.
Methods
- None (no instance methods beyond those inherited from System.Enum / System.ValueType) Typical methods available are inherited (ToString, HasFlag, CompareTo, etc.). There are no custom methods declared on this enum.
Usage Example
void HandleSourceUpdate(SourceUpdateType updateType, EffectSource source)
{
switch (updateType)
{
case SourceUpdateType.Add:
CreatePersistentSource(source);
break;
case SourceUpdateType.Temp:
CreateTemporarySource(source);
break;
case SourceUpdateType.Snap:
SnapSourceToPosition(source, targetPosition);
break;
case SourceUpdateType.Remove:
RemoveSource(source);
break;
case SourceUpdateType.WrongPrefab:
Debug.LogWarning($"Wrong prefab for source {source.Id}, skipping.");
break;
}
}
Notes: - Use the enum to clearly communicate intended lifecycle changes for effect sources between systems (producers, managers, and consumers). - Handle WrongPrefab defensively to avoid runtime errors when prefab types do not match expected effect handlers.