Table of Contents

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

public WorldIconInfo(ITransformObject transform, IAssetLink<EffectAsset> effect, Team? targetTeam = null, WarfarePlayer? targetPlayer = null, Func<WarfarePlayer, bool>? playerSelector = null, float lifetimeSec = 0)

Parameters

transform ITransformObject
effect IAssetLink<EffectAsset>
targetTeam Team
targetPlayer WarfarePlayer
playerSelector Func<WarfarePlayer, bool>
lifetimeSec float
public WorldIconInfo(Transform transform, IAssetLink<EffectAsset> effect, Team? targetTeam = null, WarfarePlayer? targetPlayer = null, Func<WarfarePlayer, bool>? playerSelector = null, float lifetimeSec = 0)

Parameters

transform Transform
effect IAssetLink<EffectAsset>
targetTeam Team
targetPlayer WarfarePlayer
playerSelector Func<WarfarePlayer, bool>
lifetimeSec float
public WorldIconInfo(Vector3 startPosition, IAssetLink<EffectAsset> effect, Team? targetTeam = null, WarfarePlayer? targetPlayer = null, Func<WarfarePlayer, bool>? playerSelector = null, float lifetimeSec = 0)

Parameters

startPosition Vector3
effect IAssetLink<EffectAsset>
targetTeam Team
targetPlayer WarfarePlayer
playerSelector Func<WarfarePlayer, bool>
lifetimeSec float

Properties

Alive

If this object is still alive.

public bool Alive { get; }

Property Value

bool

ApplyFullTransform

If the rotation and scale of the target object should be taken into account. Defaults to false.

public bool ApplyFullTransform { get; }

Property Value

bool

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

bool

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

bool

IsVisible

public bool IsVisible { get; set; }

Property Value

bool

LifetimeSeconds

Number of seconds this effect will be alive.

public float LifetimeSeconds { get; }

Property Value

float

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

Func<WarfarePlayer, bool>

RelevanceDistance

Radius in distance this effect should be shown. Takes the minimum of this and RelevanceRegions.

public float RelevanceDistance { get; set; }

Property Value

float

RelevanceRegions

Radius in regions this effect should be shown. Takes the minimum of this and RelevanceDistance.

public byte RelevanceRegions { get; set; }

Property Value

byte

Reliable

If the effect should be sent reliably.

public bool Reliable { get; set; }

Property Value

bool

Remarks

Defaults to false.

TargetPlayer

Optional player-only target.

public WarfarePlayer? TargetPlayer { get; }

Property Value

WarfarePlayer

TargetTeam

Optional team-only target.

public Team? TargetTeam { get; }

Property Value

Team

TickSpeed

Number of seconds between updates.

public float TickSpeed { get; init; }

Property Value

float

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

ITransformObject

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

seconds float

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.