public void Trigger(UnitTB unit) { foreach (EffectAttr effectAttr in effect.effectAttrs) { if (effectAttr.type == _EffectAttrType.PointGain) { GameControlTB.GainPoint((int)effectAttr.value); } } if (enableAOE && aoeRange > 1) { List <Tile> list = GridManager.GetTilesWithinRange(occupiedTile, aoeRange); foreach (Tile tile in list) { if (tile.unit != null) { tile.unit.ApplyCollectibleEffect(effect); } } } else { unit.ApplyCollectibleEffect(effect); } if (triggerEffect != null) { Instantiate(triggerEffect, occupiedTile.pos, Quaternion.identity); } if (triggerAudio != null) { AudioManager.PlaySound(triggerAudio, thisT.position); } Destroy(thisObj); }
public void Trigger(UnitTB unit) { foreach(EffectAttr effectAttr in effect.effectAttrs){ if(effectAttr.type==_EffectAttrType.PointGain){ GameControlTB.GainPoint((int)effectAttr.value); } } if(enableAOE && aoeRange>1){ List<Tile> list=GridManager.GetTilesWithinRange(occupiedTile, aoeRange); foreach(Tile tile in list){ if(tile.unit!=null){ tile.unit.ApplyCollectibleEffect(effect); } } } else unit.ApplyCollectibleEffect(effect); if(triggerEffect!=null){ Instantiate(triggerEffect, occupiedTile.pos, Quaternion.identity); } if(triggerAudio!=null){ AudioManager.PlaySound(triggerAudio, thisT.position); } Destroy(thisObj); }