private void Awake() { _collider = GetComponent <SphereCollider>(); cellLife = GetComponentInParent <CellLife>(); cell = GetComponentInParent <Cell>(); cell.onMutate += new CellEvent(RecalculateAttack); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex) { base.OnStateEnter(animator, animatorStateInfo, layerIndex); if (life == null) { life = cell.GetComponent <CellLife>(); } }
void MakeDamage(CellLife otherCell) { var heading = otherCell.mtransform.position - cellLife.mtransform.position; otherCell.HandleDamage(this.damage + minDamage + cell.CellSize() / 2f, type, heading * 100); }