public override void DoBUFF(UnitMonoBehaciour unit, UnitMonoBehaciour target) { float attack = unit.Attritube.GetFloat(UnitStaticAttritubeType.Attack); foreach (var unitMono in BuffTools.GetOverlapSphereUnit(target.gameObject.transform.position, Value_0)) { if (unitMono != target && unitMono != unit) { float dis = Vector3.Distance(unitMono.transform.position, target.transform.position); dis = Mathf.Clamp(dis, 1, Value_0 - 1); float damage = attack * Value_1 * ((Value_0 - dis) / Value_0); unitMono.Damage(damage); ((CannonTowerMono)unit).BoomParcitle(unitMono.gameObject, damage); } } }
public override void DoBUFF(UnitMonoBehaciour unit, UnitMonoBehaciour target) { Color color = new Color(0, 192f / 255f, 1f); foreach (var targetCol in BuffTools.GetOverlapSphereUnit(target.transform.position, Value_0)) { UnitMove move = targetCol.gameObject.GetComponent <UnitMove>(); if (!list.Contains(move)) { move.MoveSpeed *= (1f - Value_1); targetCol._DefCol = color; targetCol._Renderer.material.color = color; list.Add(move); } } }