Skip to main content

SteelSongEffect

A class in Root.Township, the global namespace.

Pooled pulse effect for the Steel Song skill: a glowing copy of the forged model's mesh that fades out over the timing window. Client side.

Constructors​

MemberWhat it is
SteelSongEffect()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

MemberWhat it is
protected readonly int _ColorProgressShader property ID for _ColorProgress.
protected readonly int _ProgressShader property ID for _Progress.
protected Material materialThis effect's material instance, shared by its mesh effects.
protected Coroutine meshAnimationThe running Animate coroutine, if any.
6 private and internal fields
MemberWhat it is
private float animationDurationLength of the current pulse in seconds; 0 when idle.
private Material baseMaterialMaterial that each effect copies in Awake.
private PooledObjectDefinition meshEffectDefinitionPool definition for the mesh effect placed on the forged model.
private List<MeshEffect> meshEffectsMesh effects this pulse has spawned.
private float progressPulse progress, counting down from 1 to 0.
private AnimationCurve timeProgressToAnimationProgressCurve mapping pulse progress to the shader's _Progress value.

Properties​

MemberWhat it is
float RemainigTime { get; }Time left in the current pulse. SteelSong counts a hit as good when this is under its precision leeway.

Methods​

MemberWhat it is
void InitializeEffect(Component component)Spawns a mesh effect on the component's forged model using this effect's material, and starts the animation.
void PlayEffect(float duration, float progress)Restarts the pulse with a new duration and a colour progress (the streak level).
override void Release()Cleans up the mesh effects, then returns the object to its pool.
protected IEnumerator Animate() (iterator)Coroutine that runs progress from 1 down to 0 over the duration, then releases the effect.
protected void CleanEffects()Clears and releases every mesh effect this pulse created.
1 private and internal method
MemberWhat it is
private void Awake()Makes this effect's own copy of the base material.

Used in​

Members of other types that take, return or hold a SteelSongEffect: