public DamageSpawn() { AssetProxy prefabLoader = new AssetProxy(typeof(GameObject)); GameObject buffPrefab = prefabLoader.LoadAsset("Objects/Buffs/Damage.prefab"); buffObject = Object.Instantiate(buffPrefab); DamageBuff healBuffScript = buffObject.GetComponent <DamageBuff>(); healBuffScript.damage = DAMAGE_UPGRADE_AMOUNT; buffObject.transform.localScale = new Vector3(0.25f, 0.25f, 0.25f); }
public override bool ApplyEffect(Vector2 effectPosition) { List <Unit> units = ColliderManager.instance.ReturnUnitInRadius(effectPosition, Radius); for (int i = 0; i < units.Count; i++) { if (units[i].side == Faction.Player) { DamageBuff buff = units[i].gameObject.AddComponent <DamageBuff>(); buff.BuffDamage = BuffDamage; buff.StartEffect(DurationEffect); } } base.ApplyEffect(effectPosition); return(true); }