protected override void Run(EventType.UnitLeaveSightRange args) { AOIEntity a = args.A; AOIEntity b = args.B; if (a.Unit.Type != UnitType.Player) { return; } UnitHelper.NoticeUnitRemove(a.GetParent <Unit>(), b.GetParent <Unit>()); }
protected override async ETTask Run(EventType.UnitLeaveSightRange args) { await ETTask.CompletedTask; AOIEntity a = args.A; AOIEntity b = args.B; if (a.Unit.Type != UnitType.Player) { return; } UnitHelper.NoticeUnitRemove(a.GetParent <Unit>(), b.GetParent <Unit>()); }
protected override void Run(EventType.UnitEnterSightRange args) { AOIEntity a = args.A; AOIEntity b = args.B; if (a.Id == b.Id) { return; } Unit ua = a.GetParent <Unit>(); if (ua.Type != UnitType.Player) { return; } Unit ub = b.GetParent <Unit>(); UnitHelper.NoticeUnitAdd(ua, ub); }
protected override async ETTask Run(Scene scene, EventType.UnitEnterSightRange args) { AOIEntity a = args.A; AOIEntity b = args.B; if (a.Id == b.Id) { return; } Unit ua = a.GetParent <Unit>(); if (ua.Type != UnitType.Player) { return; } Unit ub = b.GetParent <Unit>(); MessageHelper.NoticeUnitAdd(ua, ub); await ETTask.CompletedTask; }