Exemplo n.º 1
0
        private Transform[] PitchOnTargetOnSkillData(SkillData data)
        {
            //List<Transform> list = new List<Transform>();
            //for (int i = 0; i < data.attackTargetTags.Length; i++)
            //{
            //    GameObject[] tempGO = GameObject.FindGameObjectsWithTag(data.attackTargetTags[i]);
            //    Transform[] tempTF = tempGO.Select(g => g.transform);
            //    list.AddRange(tempTF);
            //}
            //Transform[] allTarget = list.ToArray();
            //allTarget = allTarget.FindAll(t =>
            //     Vector3.Distance(t.position, transform.position) <= data.attackDistance &&
            //     t.GetComponent<CharacterStatus>().HP > 0
            //);
            //return allTarget.GetMin(t => Vector3.Distance(t.position, transform.position));
            SectorSelector selector = SkillDeployerConfigFactory.CreateObject <SectorSelector>("ARPGDemo.Skill.SectorSelector");

            return(selector.SelectTarget(transform, data));
        }
Exemplo n.º 2
0
 private Transform FindTarget()
 {
     Transform[] targets = new SectorSelector().SelectTarget(transform, data);
     return(targets.Length == 0 ? null : targets[0]);
 }