Skip to main content

SkillHitTarget

A class in Root.Township, the global namespace.

Client-side pooled trigger target for a TargetBasedSkill: when the player's tool touches it, the skill hit is checked and run.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private Quaternion baseRotationRotation from world up to this target's up, used to orient the hit direction.
private TargetBasedSkill skillThe skill that validates and runs the hit.
private ImpactTool targetToolImpact tool on the target entity. Only its rigidbody counts.
private uint toolIdentifierNetwork identifier of the tool entity, passed to the skill.
private Collider triggerTrigger collider used for the contact.

Methods​

MemberWhat it is
void InitializeTarget(NetworkEntity target, TargetBasedSkill skill)Sets the tool entity and skill this target belongs to and stores its base rotation.
2 private and internal methods
MemberWhat it is
private void OnTriggerEnter(Collider other)If the target tool enters, builds a hit and, when the skill accepts it, calls the skill's ExecuteOnClient.
private void OnValidate()Editor: finds the first trigger collider in children if trigger is empty.