航海开出元宝的动画版
This commit is contained in:
@@ -651,6 +651,7 @@
|
|||||||
E897ABFC28AF2E71003B3587 /* XPSailingGiftView.m in Sources */ = {isa = PBXBuildFile; fileRef = E897ABFB28AF2E71003B3587 /* XPSailingGiftView.m */; };
|
E897ABFC28AF2E71003B3587 /* XPSailingGiftView.m in Sources */ = {isa = PBXBuildFile; fileRef = E897ABFB28AF2E71003B3587 /* XPSailingGiftView.m */; };
|
||||||
E897ABFF28AF39B4003B3587 /* XPSailingAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = E897ABFE28AF39B4003B3587 /* XPSailingAnimationView.m */; };
|
E897ABFF28AF39B4003B3587 /* XPSailingAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = E897ABFE28AF39B4003B3587 /* XPSailingAnimationView.m */; };
|
||||||
E897AC0128AF6B90003B3587 /* sailing_prize.svga in Resources */ = {isa = PBXBuildFile; fileRef = E897AC0028AF6B90003B3587 /* sailing_prize.svga */; };
|
E897AC0128AF6B90003B3587 /* sailing_prize.svga in Resources */ = {isa = PBXBuildFile; fileRef = E897AC0028AF6B90003B3587 /* sailing_prize.svga */; };
|
||||||
|
E897AC0328AF9DDE003B3587 /* sailing_prize_cowry.svga in Resources */ = {isa = PBXBuildFile; fileRef = E897AC0228AF9DDE003B3587 /* sailing_prize_cowry.svga */; };
|
||||||
E8998D7A2859784200C68558 /* XPSVGAPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E8998D792859784200C68558 /* XPSVGAPlayer.m */; };
|
E8998D7A2859784200C68558 /* XPSVGAPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E8998D792859784200C68558 /* XPSVGAPlayer.m */; };
|
||||||
E8998D8028597B0300C68558 /* XPRoomLuckyBigPrizeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8998D7F28597B0300C68558 /* XPRoomLuckyBigPrizeView.m */; };
|
E8998D8028597B0300C68558 /* XPRoomLuckyBigPrizeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8998D7F28597B0300C68558 /* XPRoomLuckyBigPrizeView.m */; };
|
||||||
E8998D82285982EE00C68558 /* lucky_gift_streamer.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8998D81285982EE00C68558 /* lucky_gift_streamer.svga */; };
|
E8998D82285982EE00C68558 /* lucky_gift_streamer.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8998D81285982EE00C68558 /* lucky_gift_streamer.svga */; };
|
||||||
@@ -2230,6 +2231,7 @@
|
|||||||
E897ABFD28AF39B4003B3587 /* XPSailingAnimationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSailingAnimationView.h; sourceTree = "<group>"; };
|
E897ABFD28AF39B4003B3587 /* XPSailingAnimationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSailingAnimationView.h; sourceTree = "<group>"; };
|
||||||
E897ABFE28AF39B4003B3587 /* XPSailingAnimationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSailingAnimationView.m; sourceTree = "<group>"; };
|
E897ABFE28AF39B4003B3587 /* XPSailingAnimationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSailingAnimationView.m; sourceTree = "<group>"; };
|
||||||
E897AC0028AF6B90003B3587 /* sailing_prize.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = sailing_prize.svga; sourceTree = "<group>"; };
|
E897AC0028AF6B90003B3587 /* sailing_prize.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = sailing_prize.svga; sourceTree = "<group>"; };
|
||||||
|
E897AC0228AF9DDE003B3587 /* sailing_prize_cowry.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = sailing_prize_cowry.svga; sourceTree = "<group>"; };
|
||||||
E8998D782859784200C68558 /* XPSVGAPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSVGAPlayer.h; sourceTree = "<group>"; };
|
E8998D782859784200C68558 /* XPSVGAPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSVGAPlayer.h; sourceTree = "<group>"; };
|
||||||
E8998D792859784200C68558 /* XPSVGAPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSVGAPlayer.m; sourceTree = "<group>"; };
|
E8998D792859784200C68558 /* XPSVGAPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSVGAPlayer.m; sourceTree = "<group>"; };
|
||||||
E8998D7E28597B0300C68558 /* XPRoomLuckyBigPrizeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomLuckyBigPrizeView.h; sourceTree = "<group>"; };
|
E8998D7E28597B0300C68558 /* XPRoomLuckyBigPrizeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomLuckyBigPrizeView.h; sourceTree = "<group>"; };
|
||||||
@@ -6018,6 +6020,7 @@
|
|||||||
E8A1E45C276220B100B294CA /* Sources */ = {
|
E8A1E45C276220B100B294CA /* Sources */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
E897AC0228AF9DDE003B3587 /* sailing_prize_cowry.svga */,
|
||||||
E897AC0028AF6B90003B3587 /* sailing_prize.svga */,
|
E897AC0028AF6B90003B3587 /* sailing_prize.svga */,
|
||||||
9B8DE0E7289CFE8100FB6EC2 /* compound_gift_banner.svga */,
|
9B8DE0E7289CFE8100FB6EC2 /* compound_gift_banner.svga */,
|
||||||
E852D7372862C615001465ED /* room_lucky_gift_bg.svga */,
|
E852D7372862C615001465ED /* room_lucky_gift_bg.svga */,
|
||||||
@@ -7483,6 +7486,7 @@
|
|||||||
9B8DE0E8289CFE8100FB6EC2 /* compound_gift_banner.svga in Resources */,
|
9B8DE0E8289CFE8100FB6EC2 /* compound_gift_banner.svga in Resources */,
|
||||||
E897AC0128AF6B90003B3587 /* sailing_prize.svga in Resources */,
|
E897AC0128AF6B90003B3587 /* sailing_prize.svga in Resources */,
|
||||||
E8E859E128264D7B00EE4857 /* images in Resources */,
|
E8E859E128264D7B00EE4857 /* images in Resources */,
|
||||||
|
E897AC0328AF9DDE003B3587 /* sailing_prize_cowry.svga in Resources */,
|
||||||
E8E859E028264D7B00EE4857 /* css in Resources */,
|
E8E859E028264D7B00EE4857 /* css in Resources */,
|
||||||
E8937AC7276C3EDE00B2C7E1 /* svga_member_in_lv40.svga in Resources */,
|
E8937AC7276C3EDE00B2C7E1 /* svga_member_in_lv40.svga in Resources */,
|
||||||
E8A1E461276220DA00B294CA /* candyTree.svga in Resources */,
|
E8A1E461276220DA00B294CA /* candyTree.svga in Resources */,
|
||||||
|
@@ -494,6 +494,7 @@
|
|||||||
_sailingImageView = [[UIImageView alloc] init];
|
_sailingImageView = [[UIImageView alloc] init];
|
||||||
_sailingImageView.image = [UIImage imageNamed:@"room_sailiing_enter"];
|
_sailingImageView.image = [UIImage imageNamed:@"room_sailiing_enter"];
|
||||||
_sailingImageView.userInteractionEnabled = YES;
|
_sailingImageView.userInteractionEnabled = YES;
|
||||||
|
_sailingImageView.hidden = YES;
|
||||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sailTapRecognizer)];
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sailTapRecognizer)];
|
||||||
[_sailingImageView addGestureRecognizer:tap];
|
[_sailingImageView addGestureRecognizer:tap];
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
||||||
|
|
||||||
#define KitemHeight (20 + 5)
|
#define KitemHeight (20 + 5)
|
||||||
@interface XPSailingViewController ()<XPSailingProtocol, NIMSystemNotificationManagerDelegate>
|
@interface XPSailingViewController ()<XPSailingProtocol, NIMSystemNotificationManagerDelegate, SVGAPlayerDelegate>
|
||||||
///顶部的View
|
///顶部的View
|
||||||
@property (nonatomic,strong) UIView * topView;
|
@property (nonatomic,strong) UIView * topView;
|
||||||
///背景图
|
///背景图
|
||||||
@@ -44,6 +44,10 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
@property (strong, nonatomic) SVGAParser *parser;
|
@property (strong, nonatomic) SVGAParser *parser;
|
||||||
///航海特效
|
///航海特效
|
||||||
@property (nonatomic,strong) SVGAImageView *sailingView;
|
@property (nonatomic,strong) SVGAImageView *sailingView;
|
||||||
|
///动画管理类
|
||||||
|
@property (strong, nonatomic) SVGAParser *parser1;
|
||||||
|
///航海开出元宝特效特效
|
||||||
|
@property (nonatomic,strong) SVGAImageView *sailingCowryView;
|
||||||
///排行榜
|
///排行榜
|
||||||
@property (nonatomic,strong) UIButton *rankButton;
|
@property (nonatomic,strong) UIButton *rankButton;
|
||||||
///h获取燃油
|
///h获取燃油
|
||||||
@@ -120,6 +124,7 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
[self.view addSubview:self.backImageView];
|
[self.view addSubview:self.backImageView];
|
||||||
|
|
||||||
[self.backImageView addSubview:self.sailingView];
|
[self.backImageView addSubview:self.sailingView];
|
||||||
|
[self.backImageView addSubview:self.sailingCowryView];
|
||||||
[self.backImageView addSubview:self.sailingImageView];
|
[self.backImageView addSubview:self.sailingImageView];
|
||||||
[self.backImageView addSubview:self.rankButton];
|
[self.backImageView addSubview:self.rankButton];
|
||||||
[self.backImageView addSubview:self.getFuleButton];
|
[self.backImageView addSubview:self.getFuleButton];
|
||||||
@@ -158,6 +163,10 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
make.edges.mas_equalTo(self.backImageView);
|
make.edges.mas_equalTo(self.backImageView);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
[self.sailingCowryView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.mas_equalTo(self.backImageView);
|
||||||
|
}];
|
||||||
|
|
||||||
[self.sailingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.sailingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.edges.mas_equalTo(self.backImageView);
|
make.edges.mas_equalTo(self.backImageView);
|
||||||
}];
|
}];
|
||||||
@@ -243,6 +252,8 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)startSailingSVGA {
|
- (void)startSailingSVGA {
|
||||||
|
[self.sailingCowryView stopAnimation];
|
||||||
|
[self.sailingView stopAnimation];
|
||||||
@kWeakify(self);
|
@kWeakify(self);
|
||||||
[self.parser parseWithNamed:@"sailing_prize" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
[self.parser parseWithNamed:@"sailing_prize" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||||
@kStrongify(self);
|
@kStrongify(self);
|
||||||
@@ -257,6 +268,21 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)startSailingPrizeCowrySVGA {
|
||||||
|
@kWeakify(self);
|
||||||
|
[self.parser1 parseWithNamed:@"sailing_prize_cowry" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||||
|
@kStrongify(self);
|
||||||
|
self.sailingCowryView.layer.masksToBounds = YES;
|
||||||
|
self.sailingCowryView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
|
self.sailingCowryView.loops = 1;
|
||||||
|
self.sailingCowryView.clearsAfterStop = YES;
|
||||||
|
self.sailingCowryView.videoItem = videoItem;
|
||||||
|
[self.sailingCowryView startAnimation];
|
||||||
|
} failureBlock:^(NSError * _Nonnull error) {
|
||||||
|
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - XPSailingProtocol
|
#pragma mark - XPSailingProtocol
|
||||||
- (void)getSailingInfoSuccess:(RoomSailingInfoModel *)info {
|
- (void)getSailingInfoSuccess:(RoomSailingInfoModel *)info {
|
||||||
self.sailingInfo = info;
|
self.sailingInfo = info;
|
||||||
@@ -265,8 +291,6 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)openSailingSuccess:(RoomSailingPrizeListModel *)model {
|
- (void)openSailingSuccess:(RoomSailingPrizeListModel *)model {
|
||||||
[self.sailingView stopAnimation];
|
|
||||||
self.sailingImageView.hidden = NO;
|
|
||||||
self.sailingInfo.keyNum = model.remainKeyNum;
|
self.sailingInfo.keyNum = model.remainKeyNum;
|
||||||
NSString * fuleStr = [NSString stringWithFormat:@"%ld", self.sailingInfo.keyNum];
|
NSString * fuleStr = [NSString stringWithFormat:@"%ld", self.sailingInfo.keyNum];
|
||||||
[self.fuleButton setTitle:fuleStr forState:UIControlStateNormal];
|
[self.fuleButton setTitle:fuleStr forState:UIControlStateNormal];
|
||||||
@@ -282,6 +306,13 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
[TTPopup popupView:prizeView style:TTPopupStyleAlert];
|
[TTPopup popupView:prizeView style:TTPopupStyleAlert];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (model.specialStatus) {
|
||||||
|
[self startSailingPrizeCowrySVGA];
|
||||||
|
} else {
|
||||||
|
self.sailingImageView.hidden = NO;
|
||||||
|
[self.sailingView stopAnimation];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[model.prizeItemList enumerateObjectsUsingBlock:^(RoomSailingPrizeModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
[model.prizeItemList enumerateObjectsUsingBlock:^(RoomSailingPrizeModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if (obj.prizeLevel > 2) {
|
if (obj.prizeLevel > 2) {
|
||||||
@@ -308,7 +339,7 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
} completion:^(BOOL finished) {
|
} completion:^(BOOL finished) {
|
||||||
if (i == (self.animationView.subviews.count -1)) {
|
if (i == (self.animationView.subviews.count -1)) {
|
||||||
[self.animationView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
[self.animationView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
[self performSelector:@selector(giftViewRemoveFromSuperView:) withObject:obj afterDelay:3];
|
[self performSelector:@selector(giftViewRemoveFromSuperView:) withObject:obj afterDelay:15];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
@@ -327,6 +358,14 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
self.exploreButton.userInteractionEnabled = YES;
|
self.exploreButton.userInteractionEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - SVGAPlayerDelegate
|
||||||
|
- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player {
|
||||||
|
if (player == self.sailingCowryView) {
|
||||||
|
[self.sailingView stopAnimation];
|
||||||
|
self.sailingImageView.hidden = NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Event Response
|
#pragma mark - Event Response
|
||||||
- (void)dismissView {
|
- (void)dismissView {
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
@@ -601,10 +640,21 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
_sailingView = [[SVGAImageView alloc]init];
|
_sailingView = [[SVGAImageView alloc]init];
|
||||||
_sailingView.backgroundColor = [UIColor clearColor];
|
_sailingView.backgroundColor = [UIColor clearColor];
|
||||||
_sailingView.userInteractionEnabled = NO;
|
_sailingView.userInteractionEnabled = NO;
|
||||||
|
_sailingView.delegate = self;
|
||||||
}
|
}
|
||||||
return _sailingView;
|
return _sailingView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (SVGAImageView *)sailingCowryView {
|
||||||
|
if (!_sailingCowryView) {
|
||||||
|
_sailingCowryView = [[SVGAImageView alloc]init];
|
||||||
|
_sailingCowryView.backgroundColor = [UIColor clearColor];
|
||||||
|
_sailingCowryView.userInteractionEnabled = NO;
|
||||||
|
_sailingCowryView.delegate = self;
|
||||||
|
}
|
||||||
|
return _sailingCowryView;
|
||||||
|
}
|
||||||
|
|
||||||
- (SVGAParser *)parser {
|
- (SVGAParser *)parser {
|
||||||
if (!_parser) {
|
if (!_parser) {
|
||||||
_parser = [[SVGAParser alloc]init];
|
_parser = [[SVGAParser alloc]init];
|
||||||
@@ -612,6 +662,13 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
|
|||||||
return _parser;
|
return _parser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (SVGAParser *)parser1 {
|
||||||
|
if (!_parser1) {
|
||||||
|
_parser1 = [[SVGAParser alloc]init];
|
||||||
|
}
|
||||||
|
return _parser1;
|
||||||
|
}
|
||||||
|
|
||||||
- (UIImageView *)sailingImageView {
|
- (UIImageView *)sailingImageView {
|
||||||
if (!_sailingImageView) {
|
if (!_sailingImageView) {
|
||||||
_sailingImageView = [[UIImageView alloc] init];
|
_sailingImageView = [[UIImageView alloc] init];
|
||||||
|
BIN
xplan-ios/Sources/sailing_prize_cowry.svga
Normal file
BIN
xplan-ios/Sources/sailing_prize_cowry.svga
Normal file
Binary file not shown.
Reference in New Issue
Block a user