新增夺宝精灵
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
#import "XPWebViewController.h"
|
||||
#import "PIBaseAnimationViewModel.h"
|
||||
#import "PIFullScreenBannerAnimation.h"
|
||||
#import "XPTreasureFairyGiftView.h"
|
||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate,XPRoomLicneseHourRankViewDelegate, XPRoomGraffitiGiftAnimationViewDelegate, XPRoomStarKitchenBannerViewDelegate>
|
||||
///展示的不同层级
|
||||
///最底层的
|
||||
@@ -222,6 +223,8 @@
|
||||
[self receiveRoomGraffitiStarKitchen:attachment];
|
||||
}else if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){
|
||||
[self receiveCandyTreeGiftHighLevle:attachment];
|
||||
}else if (attachment.first == CustomMessageType_Treasure_Fairy && (attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L1 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L2 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) { //夺宝精灵
|
||||
[self receiveTreasureFairyGiftHighLevel:attachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -414,6 +417,76 @@
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
|
||||
}
|
||||
#pragma mark - 夺宝精灵横幅
|
||||
- (void)receiveTreasureFairyGiftHighLevel:(AttachmentModel *)attatchment {
|
||||
if ([self isInSudGame]) {return;}
|
||||
|
||||
if ([self isInSudGame]) {return;}
|
||||
PIBaseAnimationViewModel *giftModel = [PIBaseAnimationViewModel new];
|
||||
giftModel.data = attatchment.data;
|
||||
giftModel.second = attatchment.second;
|
||||
giftModel.first = attatchment.first;
|
||||
giftModel.type = GiftBannerType_Fairy;
|
||||
if (self.animationListB.count == 0 && self.isPlayOfB == NO) {
|
||||
[self createTreasureFairyBannerAnimation:giftModel];
|
||||
}
|
||||
[self.animationListB addObject:giftModel];
|
||||
|
||||
}
|
||||
- (void)createTreasureFairyBannerAnimation:(PIBaseAnimationViewModel *)attatchment {
|
||||
CGFloat kscale = (CGFloat)60 / (CGFloat)375;
|
||||
CGFloat top = self.isPlayOfA == YES ? (190 + statusbarHeight) : (kNavigationHeight + 15);
|
||||
XPTreasureFairyGiftView *treasureView = [[XPTreasureFairyGiftView alloc] initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale)];
|
||||
//最大礼物
|
||||
if ((attatchment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5) || (attatchment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) {
|
||||
treasureView.isMaxLargeGift = YES;
|
||||
}else{
|
||||
treasureView.isMaxLargeGift = NO;
|
||||
}
|
||||
if ((attatchment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4) || (attatchment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5)) {
|
||||
treasureView.isDrawGift = YES; //抽奖
|
||||
}else{
|
||||
treasureView.isDrawGift = NO; //召唤
|
||||
}
|
||||
treasureView.treasureInfo = attatchment.data;
|
||||
[self.middleLevelView addSubview:treasureView];
|
||||
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
springAnimation.springSpeed = 12;
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:treasureView.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(treasureView.frame.size.width / 2, treasureView.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, treasureView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, treasureView.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) {
|
||||
[treasureView removeFromSuperview];
|
||||
self.isPlayOfB = NO;
|
||||
if (self.animationListB.count > 0) {
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
// if(self. isAnimationListAFinish == YES){
|
||||
//
|
||||
// [self playAnimationWithModel];
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
}
|
||||
}];
|
||||
[treasureView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
[treasureView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
#pragma mark - 涂鸦礼物动画
|
||||
- (void)receiveRoomGraffitiGift:(AttachmentModel *)attacment {
|
||||
if (self.graffitiGiftQueue.count == 0) {
|
||||
@@ -1457,6 +1530,8 @@
|
||||
[self createAnchorHourRankAnimation:model];
|
||||
}else if(model.type == GiftBannerType_LicneseHour){
|
||||
[self createLicneseHourRankAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Fairy){
|
||||
[self createTreasureFairyBannerAnimation:model];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user