HitModifierEffect
A class in Root.Township, Alta.Impact.
Plays a stat upgrade visual effect between two places (the object, the hit target or the wielder) when an ImpactModifier modifies a hit. The server sends it to players in the chunk.
- Listed in Items, inventory and logic
- Inherits or implements
NetworkEntityBehaviour - Nested types
EffectPosition,SyncHitArguments
Constructors
| Member | What it is |
|---|---|
HitModifierEffect() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private Color effectColor | Colour passed to the effect. |
private PooledObjectDefinition effectDefinition | Pool definition of the StatUpgradeEffect to play. |
private float effectDuration | How long the effect lasts. |
private Transform localTarget | Transform used when source or target is this object. |
private float minimumEffectivenessToPlay | Hits below this effectiveness show no effect. |
private HitModifierEffect.EffectPosition source | Where the effect starts: this object, the hit target or the wielder. |
private MethodSyncStruct<HitModifierEffect.SyncHitArguments> syncHit | Synced method that carries the effect to clients. |
private HitModifierEffect.EffectPosition target | Where the effect goes: this object, the hit target or the wielder. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the synced method used to send the effect. |
override void InitializeAsServer(SpawnData spawnData) | Server: hooks OnModifiedHit on the ImpactModifier on this object. |
2 private and internal methods
| Member | What it is |
|---|---|
private void PlayEffects(ImpactHitWithTool hit) | Server: on a hit effective enough, plays the effect locally if not headless and sends it to the chunk. |
private void SyncHit(IPlayer player, Stream stream, HitModifierEffect.SyncHitArguments arguments) | Reads or writes the source and target entity IDs; on clients, finds them and plays the effect. |