public override void Launch() { UnitHealth enemyUnit; foreach (RaycastHit hit in Physics.BoxCastAll(spellIndicator.transform.position, new Vector3(spellRange, 2f, 2f), Vector3.up)) { if (hit.collider.tag != this.tag && (enemyUnit = hit.collider.GetComponent <UnitHealth>()) != null) { enemyUnit.TakeDamage(spellPower); } } Destroy(spellIndicator); unit.GetComponent <Rigidbody>().AddForce(-unit.transform.forward * 50f, ForceMode.VelocityChange); rootStatus = new RootStatus(); if (!rootStatus.Init(unit.GetComponent <Unit>())) { rootStatus = null; } phaseStatus = new PhaseStatus(); if (!phaseStatus.Init(unit.GetComponent <Unit>())) { phaseStatus = null; } jumpTimer = jumpLenght; }
public override void Init(string tag, GameObject unit) { base.Init(tag, unit); spellIndicator.GetComponent <DecalProjectorComponent>().m_Size = new Vector3(spellRange * 2f, 2f, 1f); material = spellIndicator.GetComponent <DecalProjectorComponent>().m_Material; rootStatus = new RootStatus(); if (!rootStatus.Init(unit.GetComponent <Unit>())) { rootStatus = null; } unit.GetComponentInChildren <Animator>().SetBool("FireRoot", true); }