public bool IsIgnoreCollider(Collider collider) { if (collider.transform.IsChildOf(transform)) { return(true); } if (collider.transform.tag == "WorldCollider") { return(true); } if (collider.isTrigger) { CheckEnergyShield(collider); return(true); } //AiDataObject aiDataObject = collider.GetComponent<AiDataObject>(); //if (aiDataObject != null && !(aiDataObject is AiSceneStaticObject)) // return true; if (emitRunner != null) { Transform root = emitRunner.transform; CreationSkillRunner creation = VCUtils.GetComponentOrOnParent <CreationSkillRunner>(root.gameObject); if (creation != null) { root = creation.transform; } if (collider.transform.IsChildOf(root)) { return(true); } // if (emitRunner is ShootEquipment) // { // if ((emitRunner as ShootEquipment).IsChild(collider.transform)) // { // return true; // } // } } return(false); }
internal override List <ISkillTarget> GetTargetlistInScope(EffScope scope, int targetMask, ISkillTarget target) { List <ISkillTarget> targetList = new List <ISkillTarget>(); if (emitRunner == null) { return(targetList); } Collider[] cs = Physics.OverlapSphere(transform.position, scope.m_radius); List <Transform> transforms = new List <Transform>(); foreach (Collider item in cs) { if (item.isTrigger) { continue; } if (!transforms.Contains(item.transform) && !item.gameObject.Equals(this.gameObject) && !item.gameObject.Equals(emitRunner.gameObject)) { transforms.Add(item.transform); } Transform root = item.transform; CreationSkillRunner creation = VCUtils.GetComponentOrOnParent <CreationSkillRunner>(root.gameObject); if (creation != null) { if (!transforms.Contains(creation.transform)) { transforms.Add(creation.transform); } } } foreach (Transform tr in transforms) { if (tr == null || emitTransform == null) { continue; } float cosAngle = AiMath.Dot(emitTransform, tr); float angle = Mathf.Acos(cosAngle) * Mathf.Rad2Deg; int emitHarm = AiUtil.GetHarm(emitRunner.gameObject); if (GameConfig.IsMultiMode) { SkillRunner obj = tr.GetComponent <SkillRunner>(); if (null == obj) { continue; } int targetHarm = AiUtil.GetHarm(obj.gameObject); if (AiHarmData.GetHarmValue(emitHarm, targetHarm) == 0) { continue; } } else { int targetHarm = AiUtil.GetHarm(tr.gameObject); if (AiHarmData.GetHarmValue(emitHarm, targetHarm) == 0) { continue; } } Ray rayStart = new Ray(transform.position, tr.position - transform.position); float distance = Vector3.Distance(transform.position, tr.position); if (Physics.Raycast(rayStart, distance, AiUtil.groundedLayer | AiUtil.obstructLayer)) { continue; } if (angle > scope.m_degEnd || angle < scope.m_degStart) { continue; } SkillRunner runner = tr.GetComponent <SkillRunner>(); if (runner == null) { runner = VCUtils.GetComponentOrOnParent <SkillRunner>(tr.gameObject); } if (runner != null && !targetList.Contains(runner)) { targetList.Add(runner); } } return(targetList); }