Exemplo n.º 1
0
        //创建算法对象
        private void InitDeployer()
        {
            //反射创建对象
            attackSelector = SkillDeployerConfigFactory.CreateAttackSelector(currentSkillData);

            //影响对象
            impactArray = SkillDeployerConfigFactory.CreateImpactEffects(currentSkillData);
        }
Exemplo n.º 2
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));
        }