Class WorldIconInfo
- Namespace
- Uncreated.Warfare.Interaction.Icons
- Assembly
- Uncreated.Warfare.dll
Tracks information about a single icon that is kept alive.
public class WorldIconInfo : ITransformObject, IDisposable
- Inheritance
-
WorldIconInfo
- Implements
- Inherited Members
- Extension Methods
Constructors
WorldIconInfo(ITransformObject, IAssetLink<EffectAsset>, Team?, WarfarePlayer?, Func<WarfarePlayer, bool>?, float)
public WorldIconInfo(ITransformObject transform, IAssetLink<EffectAsset> effect, Team? targetTeam = null, WarfarePlayer? targetPlayer = null, Func<WarfarePlayer, bool>? playerSelector = null, float lifetimeSec = 0)
Parameters
transformITransformObjecteffectIAssetLink<EffectAsset>targetTeamTeamtargetPlayerWarfarePlayerplayerSelectorFunc<WarfarePlayer, bool>lifetimeSecfloat
WorldIconInfo(Transform, IAssetLink<EffectAsset>, Team?, WarfarePlayer?, Func<WarfarePlayer, bool>?, float)
public WorldIconInfo(Transform transform, IAssetLink<EffectAsset> effect, Team? targetTeam = null, WarfarePlayer? targetPlayer = null, Func<WarfarePlayer, bool>? playerSelector = null, float lifetimeSec = 0)
Parameters
transformTransformeffectIAssetLink<EffectAsset>targetTeamTeamtargetPlayerWarfarePlayerplayerSelectorFunc<WarfarePlayer, bool>lifetimeSecfloat
WorldIconInfo(Vector3, IAssetLink<EffectAsset>, Team?, WarfarePlayer?, Func<WarfarePlayer, bool>?, float)
public WorldIconInfo(Vector3 startPosition, IAssetLink<EffectAsset> effect, Team? targetTeam = null, WarfarePlayer? targetPlayer = null, Func<WarfarePlayer, bool>? playerSelector = null, float lifetimeSec = 0)
Parameters
startPositionVector3effectIAssetLink<EffectAsset>targetTeamTeamtargetPlayerWarfarePlayerplayerSelectorFunc<WarfarePlayer, bool>lifetimeSecfloat
Properties
Alive
If this object is still alive.
public bool Alive { get; }
Property Value
ApplyFullTransform
If the rotation and scale of the target object should be taken into account. Defaults to false.
public bool ApplyFullTransform { get; }
Property Value
Remarks
Has no effect if EffectPosition is set.
Color
Uses a shader to convert the desired rotation and scale of the effect to it's tint color.
public Color32 Color { get; set; }
Property Value
- Color32
Remarks
Only used when UnityEngine.Color32.a is max.
DebugLogging
Enables debug logging for this icon.
public bool DebugLogging { get; init; }
Property Value
Effect
The effect asset that spawns.
public IAssetLink<EffectAsset> Effect { get; }
Property Value
- IAssetLink<EffectAsset>
EffectPosition
The source of the effect's position. Interchangable with TransformableObject or UnityObject.
public Vector3 EffectPosition { get; set; }
Property Value
- Vector3
Remarks
This can be changed at any time.
IsDistanceLimited
public bool IsDistanceLimited { get; }
Property Value
IsVisible
public bool IsVisible { get; set; }
Property Value
LifetimeSeconds
Number of seconds this effect will be alive.
public float LifetimeSeconds { get; }
Property Value
Offset
The world-position offset of the effect from the original transform object.
public Vector3 Offset { get; set; }
Property Value
- Vector3
PlayerSelector
Optional player predicate.
public Func<WarfarePlayer, bool>? PlayerSelector { get; }
Property Value
RelevanceDistance
Radius in distance this effect should be shown. Takes the minimum of this and RelevanceRegions.
public float RelevanceDistance { get; set; }
Property Value
RelevanceRegions
Radius in regions this effect should be shown. Takes the minimum of this and RelevanceDistance.
public byte RelevanceRegions { get; set; }
Property Value
Reliable
If the effect should be sent reliably.
public bool Reliable { get; set; }
Property Value
Remarks
Defaults to false.
TargetPlayer
Optional player-only target.
public WarfarePlayer? TargetPlayer { get; }
Property Value
TargetTeam
Optional team-only target.
public Team? TargetTeam { get; }
Property Value
TickSpeed
Number of seconds between updates.
public float TickSpeed { get; init; }
Property Value
Remarks
Defaults to 1 second. Changes after originally creating the icon will not be applied.
TransformableObject
The source of the effect's position. Interchangable with UnityObject or Position.
public ITransformObject? TransformableObject { get; set; }
Property Value
Remarks
This can be changed at any time.
UnityObject
The source of the effect's position. Interchangable with TransformableObject or Position.
public Transform? UnityObject { get; set; }
Property Value
- Transform
Remarks
This can be changed at any time.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
KeepAliveFor(float)
Raise LifetimeSeconds such that from now the effect will despawn in a given amount of seconds.
public void KeepAliveFor(float seconds)
Parameters
secondsfloat
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.