Beispiel #1
0
 private void Awake()
 {
     _collider      = GetComponent <SphereCollider>();
     cellLife       = GetComponentInParent <CellLife>();
     cell           = GetComponentInParent <Cell>();
     cell.onMutate += new CellEvent(RecalculateAttack);
 }
Beispiel #2
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
 {
     base.OnStateEnter(animator, animatorStateInfo, layerIndex);
     if (life == null)
     {
         life = cell.GetComponent <CellLife>();
     }
 }
Beispiel #3
0
    void MakeDamage(CellLife otherCell)
    {
        var heading = otherCell.mtransform.position - cellLife.mtransform.position;

        otherCell.HandleDamage(this.damage + minDamage + cell.CellSize() / 2f, type, heading * 100);
    }