Game.SourceUpdateInfo
Assembly: Assembly-CSharp (typical Unity game assembly)
Namespace: Game.Effects
Type: struct
Base: System.ValueType
Summary:
SourceUpdateInfo is a simple data container used by the game's effects subsystem to describe an update for a "source" (an effect source, e.g., audio/visual emitter or other effect-related object). It aggregates the source's identifying information (SourceInfo), the kind of update (SourceUpdateType), and the Transform associated with the source (UnityEngine.Transform). This struct is passed around by effect update logic to inform systems what happened to a particular source and where it is in the scene.
Fields
-
public SourceInfo m_SourceInfo
This field holds the SourceInfo value (defined in Game.Objects) that identifies the source and contains whatever metadata the effect system stores for sources (ID, parameters, etc.). It is the primary identifier/payload for the update. -
public SourceUpdateType m_Type
An enum value indicating the type of update being reported for the source (for example: added, removed, moved, changed — exact enum members are defined in SourceUpdateType). Consumers use this to decide how to handle the SourceInfo and Transform. -
public Transform m_Transform
A reference to the UnityEngine.Transform of the source's GameObject. This provides position/rotation/scale context required by many effect systems when applying updates. Because it holds a UnityEngine.Object reference, the struct is not a pure blittable value.
Properties
- (none)
This struct exposes only public fields; there are no properties defined.
Constructors
- (implicit) Default parameterless constructor
As a C# struct, SourceUpdateInfo has the implicit parameterless constructor that zero-initializes its fields. No custom constructors are declared in the source.
Methods
- (none)
The struct does not declare any methods.
Usage Example
using UnityEngine;
using Game.Effects;
using Game.Objects;
// Create and populate a SourceUpdateInfo for an effect source.
void ReportSourceMoved(SourceInfo sourceInfo, Transform sourceTransform)
{
SourceUpdateInfo update = new SourceUpdateInfo
{
m_SourceInfo = sourceInfo,
m_Type = SourceUpdateType.Moved, // example enum member
m_Transform = sourceTransform
};
// Pass `update` to the effect manager / queue / job system that handles source updates.
EffectManager.Instance.QueueSourceUpdate(update);
}
Notes: - Replace SourceUpdateType.Moved with the actual enum member that fits your case. - Because m_Transform references a Unity object, be careful when using this struct across job boundaries or thread contexts — UnityEngine.Transform is not thread-safe and cannot be used inside Unity.Jobs without explicit conversion/handling.