protected virtual float[] NormalizeDmg(RecievedDamage rD) { float[] ar = { rD.fire, rD.lightning, rD.physic, rD.water }; if (ar.Max() != 0) { for (int i = 0; i < ar.Length; i++) { ar[i] = ar[i] / ar.Max(); } return(ar); } return(ar); }
public virtual void DisplayDamage(RecievedDamage rD) { float[] mults = NormalizeDmg(rD); ShowParticles(mults); StartCoroutine(CallDelayedAction(HideParticles, 1f)); }