Commit f50904d8ba667ad58bd8dc21137d98542ed8a4f1
1 parent
ac315370
修改歼灭机动画,更改互动按钮显示逻辑
Showing
16 changed files
with
30 additions
and
8 deletions
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart0@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart1@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart2.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart2@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart3.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart3@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart4.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart4@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart5@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart6@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart7@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart8@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/resource.bundle/heart@2x.png
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/LVCGiftManager.m
| @@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||
| 25 | NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | 25 | NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; |
| 26 | CGFloat width = [UIScreen mainScreen].bounds.size.width / 2; | 26 | CGFloat width = [UIScreen mainScreen].bounds.size.width / 2; |
| 27 | [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | 27 | [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; |
| 28 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | ||
| 28 | car.curveControlAndEndPoints = pointArrs; | 29 | car.curveControlAndEndPoints = pointArrs; |
| 29 | [car addAnimationsMoveToPoint:CGPointMake(0, 100) endPoint:CGPointMake(toView.bounds.size.width +166, 500)]; | 30 | [car addAnimationsMoveToPoint:CGPointMake(0, 100) endPoint:CGPointMake(toView.bounds.size.width +166, 500)]; |
| 30 | [toView addSubview:car]; | 31 | [toView addSubview:car]; |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/LVCInteractionController.m
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | 23 | ||
| 24 | - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event | 24 | - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event |
| 25 | { | 25 | { |
| 26 | - [LVCGiftManager giftType:GiftTypePorsch toView:self.view]; | 26 | + [LVCGiftManager giftType:GiftTypeFighter toView:self.view]; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | - (void)didReceiveMemoryWarning { | 29 | - (void)didReceiveMemoryWarning { |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/HomeViewController.m
| @@ -12,12 +12,24 @@ | @@ -12,12 +12,24 @@ | ||
| 12 | 12 | ||
| 13 | @interface HomeViewController () | 13 | @interface HomeViewController () |
| 14 | 14 | ||
| 15 | - | 15 | +@property (nonatomic ,strong) UIButton * _Nullable interactionBtn; |
| 16 | 16 | ||
| 17 | @end | 17 | @end |
| 18 | 18 | ||
| 19 | @implementation HomeViewController | 19 | @implementation HomeViewController |
| 20 | 20 | ||
| 21 | +- (void)viewWillAppear:(BOOL)animated | ||
| 22 | +{ | ||
| 23 | + [super viewWillAppear:animated]; | ||
| 24 | + [[UIApplication sharedApplication].keyWindow addSubview:self.interactionBtn]; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +- (void)viewWillDisappear:(BOOL)animated | ||
| 28 | +{ | ||
| 29 | + [super viewWillDisappear:animated]; | ||
| 30 | + [self.interactionBtn removeFromSuperview]; | ||
| 31 | +} | ||
| 32 | + | ||
| 21 | - (void)viewDidLoad { | 33 | - (void)viewDidLoad { |
| 22 | [super viewDidLoad]; | 34 | [super viewDidLoad]; |
| 23 | // Do any additional setup after loading the view. | 35 | // Do any additional setup after loading the view. |
| @@ -30,12 +42,7 @@ | @@ -30,12 +42,7 @@ | ||
| 30 | [liveBtn addTarget:self action:@selector(liveAction) forControlEvents:UIControlEventTouchUpInside]; | 42 | [liveBtn addTarget:self action:@selector(liveAction) forControlEvents:UIControlEventTouchUpInside]; |
| 31 | [self.view addSubview:liveBtn]; | 43 | [self.view addSubview:liveBtn]; |
| 32 | 44 | ||
| 33 | - UIButton *interactionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 34 | - interactionBtn.frame = CGRectMake(200, 400, 50, 30); | ||
| 35 | - [interactionBtn setTitle:@"互动" forState:UIControlStateNormal]; | ||
| 36 | - [interactionBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | ||
| 37 | - [interactionBtn addTarget:self action:@selector(interactionAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 38 | - [[UIApplication sharedApplication].keyWindow addSubview:interactionBtn]; | 45 | + [[UIApplication sharedApplication].keyWindow addSubview:self.interactionBtn]; |
| 39 | } | 46 | } |
| 40 | 47 | ||
| 41 | - (void)liveAction | 48 | - (void)liveAction |
| @@ -53,6 +60,20 @@ | @@ -53,6 +60,20 @@ | ||
| 53 | } | 60 | } |
| 54 | 61 | ||
| 55 | 62 | ||
| 63 | +- (UIButton *)interactionBtn | ||
| 64 | +{ | ||
| 65 | + if (!_interactionBtn) | ||
| 66 | + { | ||
| 67 | + UIButton *interactionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 68 | + interactionBtn.frame = CGRectMake(200, 400, 50, 30); | ||
| 69 | + [interactionBtn setTitle:@"互动" forState:UIControlStateNormal]; | ||
| 70 | + [interactionBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | ||
| 71 | + [interactionBtn addTarget:self action:@selector(interactionAction) forControlEvents:UIControlEventTouchUpInside]; | ||
| 72 | + _interactionBtn = interactionBtn; | ||
| 73 | + } | ||
| 74 | + return _interactionBtn; | ||
| 75 | +} | ||
| 76 | + | ||
| 56 | - (void)didReceiveMemoryWarning { | 77 | - (void)didReceiveMemoryWarning { |
| 57 | [super didReceiveMemoryWarning]; | 78 | [super didReceiveMemoryWarning]; |
| 58 | // Dispose of any resources that can be recreated. | 79 | // Dispose of any resources that can be recreated. |