新增 GiftComboManager 及相关模块的重构,优化了连击功能的接口,建立了清晰的分层架构,统一了并发模型,提升了可维护性和可测试性。同时,新增了 GiftComboConfig、GiftComboTransport 和 GiftComboUIAdapter 模块,简化了接口并提供了更好的错误处理机制,确保向后兼容性。
This commit is contained in:
@@ -121,14 +121,26 @@
|
||||
- (void)handleTapNotification:(NSNotification *)note {
|
||||
NSValue *value = note.userInfo[@"point"];
|
||||
CGPoint point = [value CGPointValue];
|
||||
|
||||
// 将 banner 中的点转换为屏幕坐标系
|
||||
CGPoint screenPoint = [self convertPoint:point toView:nil];
|
||||
|
||||
// 发送通知给 FunctionContainer 处理,传递屏幕坐标
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"BannerTapToFunctionContainer"
|
||||
object:nil
|
||||
userInfo:@{@"point": [NSValue valueWithCGPoint:screenPoint]}];
|
||||
NSLog(@"🔄 RoomHighValueGiftBannerAnimation: 接收到点击点 %@ (bannerContainer坐标系)", NSStringFromCGPoint(point));
|
||||
|
||||
// 将 bannerContainer 坐标系中的点转换为 GameUniversalBannerView 坐标系中的点
|
||||
CGPoint bannerPoint = [self convertPoint:point fromView:self.superview];
|
||||
|
||||
NSLog(@"🔄 RoomHighValueGiftBannerAnimation: 转换为 banner 坐标系 %@", NSStringFromCGPoint(bannerPoint));
|
||||
NSLog(@"%@", CGRectContainsPoint(self.goButton.frame, bannerPoint) ? @"YES" : @"NO");
|
||||
// 检查点击是否与 go 按钮重合
|
||||
CGPoint goButtonPoint = [self.goButton convertPoint:bannerPoint fromView:self];
|
||||
if ([self.goButton pointInside:goButtonPoint withEvent:nil]) {
|
||||
NSLog(@"🎯 RoomHighValueGiftBannerAnimation: tap 点与 go 按钮重合,触发游戏跳转事件");
|
||||
[self handleTapGo];
|
||||
} else {
|
||||
CGPoint screenPoint = [self convertPoint:point toView:nil];
|
||||
// 发送通知给 FunctionContainer 处理,传递屏幕坐标
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"BannerTapToFunctionContainer"
|
||||
object:nil
|
||||
userInfo:@{@"point": [NSValue valueWithCGPoint:screenPoint]}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)addNotification {
|
||||
|
Reference in New Issue
Block a user