public override List <GameObject> GetTargets(ref Vector3 casting_position, ref SkillTier tier, ref GameObjectList targets, ref GameObject caster) { List <GameObject> list = new List <GameObject>(); foreach (GameObject obj in targets.GetList()) { if (ObjectManager.Instance.GetActiveObjects(obj) != null) { foreach (GameObject entity in ObjectManager.Instance.GetActiveObjects(obj)) { if (Vector3.Distance(casting_position, entity.transform.position) < _Range * ((tier != null) ? tier.GetMultiplyer() : 1)) { list.Add(entity); } } } } return(list); }
public override void Init(Vector3 dir, float speed, ProjectileProperties projectile_properties, List <StatusEffect> Status, GameObjectList Targetable, float timer = 5, float damage = 1, float multiplyer = 1, float percentage = 0) { _Dir = dir; _speed = speed; _timer = timer * multiplyer; _damage = damage; _multiplyer = multiplyer; _percentage = percentage; _ProjectileProperties = projectile_properties; _PlayedCastingAudio = _PlayedEndingAudio = false; if (projectile_properties.GetMovingParticle() != null) { _MovingParticleCopy = Instantiate(projectile_properties.GetMovingParticle(), gameObject.transform); } if (projectile_properties.GetImpactParticle() != null) { ParticleInterface temp = projectile_properties.GetImpactParticle().GetComponent <ParticleInterface>(); temp.Init(); _impact_particle_timer = temp.GetLongestParticleEffect(); } if (_Targetable.Count > 0) { _Targetable.Clear(); } _Targetable.AddRange(Targetable.GetList()); if (_StatusEffects.Count > 0) { _StatusEffects.Clear(); } if (Status.Count > 0) { _StatusEffects.AddRange(Status); } }