MiningEcho
A class in Root.Township, the global namespace.
Progression skill: a strong pickaxe hit sends out an echo pulse whose radius grows over time, shown to the player and passed to IListenToMiningEcho listeners (probably to reveal ore).
- Listed in Global namespace: M to O
- Inherits or implements
PickupBasedSkill - Derived types
MiningEcho.Create - Nested types
Create,LevelDefinition,MiningEchoExecution
Constructors
| Member | What it is |
|---|---|
MiningEcho() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
12 private and internal fields
| Member | What it is |
|---|---|
private PooledObjectDefinition echoDefinition | Pooled effect spawned at the hit point for the local player. |
private bool hasIntensityPlus | Whether the player has the intensity upgrade skill; sent to clients with the effect. |
private float hitMinEfficiency | Minimum hit effectiveness needed to trigger the echo. |
private MiningEchoIntensity intensityPlusSkill | The MiningEchoIntensity skill that upgrades the effect. |
private int level | Zero-based skill level of the player who used it, used to pick the level definition. |
private MiningEcho.LevelDefinition[] levelDefinitions | Size and duration curve for each skill level. |
private static HashSet<IListenToMiningEcho> listeners | Static set of IListenToMiningEcho objects told about each running echo. Join with StartListening. |
private static List<MiningEcho.MiningEchoExecution> miningEchoes | Static list of echoes currently expanding. |
private ImpactChannel[] targetChannels | Impact channels the held tool must have for the skill to apply. |
private LayerMask targetLayer | Layers a tool hit must be on to trigger the echo. |
private Dictionary<Pickup, ISkillInputMethod> toolInputs | Registered skill input for each held pickup. |
private static IUnityUpdateMethod updateEchoes | Handle for the static update method while echoes are running. |
Methods
| Member | What it is |
|---|---|
override void Deregister(ISkillInputMethod input) | Forgets the input and stops listening for its tool's collisions. |
override void ExecuteWithHit(HeldPickupHandler handler, ImpactHitWithTool hitWithTool, bool hasHit = true) | Starts an echo at the hit point for the player's level, then runs the normal skill execution. |
override void Register(ISkillInputMethod input) | Remembers the input for its tool. |
override void SetEffectActive(Pickup pickup, Player player, bool isEffectActive) | Starts or stops listening for the tool's collisions. |
static void StartListening(IListenToMiningEcho listener) | Adds a listener that gets every running echo's centre and radius each frame. |
static void StopListening(IListenToMiningEcho listener) | Removes a listener. |
override bool ValidateExecutionHit(ProgressionPath path, ImpactHitWithTool hitWithTool) | Always false. The skill fires from tool collisions instead. |
override bool ValidatePickup(HeldPickupHandler pickupHandler) | True if the held tool has all the target channels. |
protected override void EffectsRequested(NetworkEntity targetEntity, ToolBasedSkillStatus status, bool isLocalPlayer) | For the local player, shows the echolocation effect at the hit for the used level. |
protected override void SerializeInternal(Stream stream) | When consumed, sends the level and whether the intensity upgrade skill is owned. |
2 private and internal methods
| Member | What it is |
|---|---|
private void Collided(Collision collision, bool isHitting, ImpactTool tool) | Handles the tool hitting something on targetLayer while the skill is active; if the hit is effective enough it resets the input and runs the echo. |
private static void UpdateEchoes() | Static update that grows each running echo, tells every listener its centre and radius, and stops when none are left. |