航海完成了
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#import "XPRoomLicneseHourRankView.h"
|
||||
#import "XPRoomLuckyBigPrizeView.h"
|
||||
#import "XPRoomGiftCompoundView.h"
|
||||
#import "XPSailingAnimationView.h"
|
||||
|
||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate,XPRoomLicneseHourRankViewDelegate>
|
||||
///展示的不同层级
|
||||
@@ -121,6 +122,8 @@
|
||||
@property (nonatomic,strong) SVGAImageView *datingEffectView;
|
||||
#pragma mark - 跨房PK
|
||||
@property (nonatomic, strong) NSMutableArray<AcrossRoomPKPrizeModel *> *acrossRoomPKQueue;
|
||||
#pragma mark - 航海
|
||||
@property (nonatomic, strong) NSMutableArray<AttachmentModel *> *sailingQueue;
|
||||
///幸运礼物动画是否在播放
|
||||
@property (nonatomic,assign) BOOL isLuckyGiftAnimation;
|
||||
@end
|
||||
@@ -272,7 +275,9 @@
|
||||
[self receiveLicneseHourRank:attachment];
|
||||
} else if (attachment.first == CustomMessageType_Gift_Compound && attachment.second == Custom_Message_Sub_Gift_Compound) {///魔法小屋合成礼物
|
||||
[self receiveGiftCompound:attachment];
|
||||
}
|
||||
} else if(attachment.first == CustomMessageType_Room_Sailing) {
|
||||
[self receiveRoomSailing:attachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,6 +619,51 @@
|
||||
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - 航海横幅
|
||||
- (void)receiveRoomSailing:(AttachmentModel *)attachment {
|
||||
if ([self isInSudGame]) {return;}
|
||||
if (self.sailingQueue.count == 0) {
|
||||
[self createSailingBannerAnimation:attachment];
|
||||
}
|
||||
[self.sailingQueue addObject:attachment];
|
||||
}
|
||||
|
||||
- (void)createSailingBannerAnimation:(AttachmentModel *)attatchment {
|
||||
CGFloat kscale = (CGFloat)60 / (CGFloat)375;
|
||||
XPSailingAnimationView *sailingView = [[XPSailingAnimationView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, KScreenWidth * kscale)];
|
||||
sailingView.prizeInfo = attatchment.data;
|
||||
[self.middleLevelView addSubview:sailingView];
|
||||
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
springAnimation.springSpeed = 12;
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:sailingView.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(sailingView.frame.size.width / 2, sailingView.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, sailingView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, sailingView.center.y)];
|
||||
moveAnimation.beginTime = CACurrentMediaTime() + 3;
|
||||
moveAnimation.duration = 0.5;
|
||||
moveAnimation.repeatCount = 1;
|
||||
moveAnimation.removedOnCompletion = YES;
|
||||
@kWeakify(self);
|
||||
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
@kStrongify(self);
|
||||
if (finished) {
|
||||
[sailingView removeFromSuperview];
|
||||
[self.sailingQueue removeObjectAtIndex:0];
|
||||
if (self.sailingQueue.count > 0) {
|
||||
[self createSailingBannerAnimation:self.sailingQueue.firstObject];
|
||||
}
|
||||
}
|
||||
}];
|
||||
[sailingView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
[sailingView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - 贵族升级
|
||||
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment {
|
||||
if (self.nobleLevelUpQueue.count == 0) {
|
||||
@@ -1765,5 +1815,12 @@
|
||||
return _acrossRoomPKQueue;
|
||||
}
|
||||
|
||||
- (NSMutableArray<AttachmentModel *> *)sailingQueue {
|
||||
if (!_sailingQueue) {
|
||||
_sailingQueue = [NSMutableArray array];
|
||||
}
|
||||
return _sailingQueue;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user