public void CreateAoe(SkillCom ower, AddAoeModel addAoe) { if (SkillLocate.Model.GetAoeModel(addAoe.id, out AoeModel model)) { AoeCom aoeCom = LCECS.ECSLocate.ECS.GetWorld().GetCom <AoeCom>(); AoeObj aoeObj = new AoeObj(); //配置 aoeObj.model = model; //预制体 if (model.asset != null && !string.IsNullOrEmpty(model.asset.ObjName)) { aoeObj.go = ToolkitLocate.GoPool.Take(model.asset.ObjName); } //拥有者 aoeObj.ower = ower; //配置数据 aoeObj.size = addAoe.size; aoeObj.duration = addAoe.duration; aoeObj.follow = addAoe.follow; //保存 aoeCom.AddAoe(aoeObj); } }
public override bool CheckActorInRange(AoeObj aoeObj, ActorObj actor) { Shape checkShape = aoeObj.CalcArea(); Entity entity = ECSLocate.ECS.GetEntity(actor.Uid); Shape body = EntityGetter.GetEntityColliderShape(entity); return(checkShape.Intersects(body)); }
public override List <ActorObj> GetActorsInRange(AoeObj aoeObj) { List <ActorObj> result = new List <ActorObj>(); int uid = aoeObj.ower.EntityId; ActorObj actor = MapLocate.Map.GetActor(uid); Entity selfEntity = ECSLocate.ECS.GetEntity(uid); CampCom selfCampCom = selfEntity.GetCom <CampCom>(); Shape checkShape = aoeObj.CalcArea(); //Ïȼì²âÍæ¼Ò Entity playerEntity = LCECS.ECSLocate.Player.GetPlayerEntity(); CampCom playerCampCom = playerEntity.GetCom <CampCom>(); if (playerEntity != null && playerEntity.Uid != uid && playerCampCom.Camp != selfCampCom.Camp) { Shape playerBody = EntityGetter.GetEntityColliderShape(playerEntity); if (checkShape.Intersects(playerBody)) { result.Add(MapLocate.Map.PlayerActor); } } //µÐ¶ÔÑÝÔ± foreach (var item in actor.Area.Actors) { if (item.Key == aoeObj.ower.EntityId) { continue; } Entity entity = ECSLocate.ECS.GetEntity(item.Key); if (entity != null) { CampCom campCom = entity.GetCom <CampCom>(); if (campCom != null && campCom.Camp != selfCampCom.Camp) { Shape body = EntityGetter.GetEntityColliderShape(entity); if (checkShape.Intersects(body)) { result.Add(item.Value); } } } } return(result); }
public override List <BulletObj> GetBulletsInRange(AoeObj aoeObj) { return(new List <BulletObj>()); }
public override bool CheckBulletInRange(AoeObj aoeObj, BulletObj bullet) { return(false); }