예제 #1
0
    List <EntityBase> GetSkillDamageList(EntityBase entity, SkillDataGenerate skillData)
    {
        CampComponent        acc = entity.GetComp <CampComponent>();
        SkillStatusComponent ssc = entity.GetComp <SkillStatusComponent>();

        List <EntityBase> result = new List <EntityBase>();
        List <EntityBase> list   = GetEntityList(new string[] { "CollisionComponent", "LifeComponent", "CampComponent" });

        SkillUtils.UpdateArea(skillAreaCache, skillData.m_EffectArea, ssc.skillDir.ToVector(), entity);

        Debug.DrawRay(skillAreaCache.position, skillAreaCache.direction, Color.red, 10);

        for (int i = 0; i < list.Count; i++)
        {
            CollisionComponent bcc    = list[i].GetComp <CollisionComponent>();
            CampComponent      bcampc = list[i].GetComp <CampComponent>();
            LifeComponent      lc     = list[i].GetComp <LifeComponent>();

            //Debug.Log("bcampc.creater " + bcampc.creater + " AreaCollideSucceed -->" + skillAreaCache.AreaCollideSucceed(bcc.area));

            if (acc.creater != bcampc.creater &&
                skillAreaCache.AreaCollideSucceed(bcc.area) &&
                lc.Life > 0)
            {
                result.Add(list[i]);
            }
        }

        return(result);
    }