private List <GameObject> FindTarget(Vector3 pos, float range, int mask) { List <GameObject> targetInfos = new List <GameObject>(); Collider[] hitColliders = Physics.OverlapSphere(pos, range, mask); int index = 0; while (index < hitColliders.Length) { if (hitColliders[index] == null || hitColliders[index].gameObject == null) { index++; continue; } GameObject target = hitColliders[index].gameObject; if (target != null) { if (Script_Util.IsChildGameObject(GetAttacker(), target.GetInstanceID())) { index++; continue; } targetInfos.Add(target); } index++; } return(targetInfos); }
private List <RaycastHit> CheckTarget(List <RaycastHit> hitInfos, SkillImpactInfos impact) { List <RaycastHit> retInfos = new List <RaycastHit>(); foreach (RaycastHit hitinfo in hitInfos) { GameObject target = hitinfo.transform.gameObject; if (Script_Util.IsChildGameObject(GetAttacker(), target.GetInstanceID())) { continue; } if (TriggerImpl.CheckTargetInImpactExcept(target, impact)) { continue; } retInfos.Add(hitinfo); } return(retInfos); }