Files
peko-ios/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationManager.h
edwinQQQ 57735e37c4 fix: 优化送礼的内存效率 |
TODO:调整 combo 时的金币变动效果
2024-12-09 19:27:02 +08:00

58 lines
1.5 KiB
Objective-C

//
// GiftAnimationManager.h
// YuMi
//
// Created by P on 2024/12/9.
//
#import <Foundation/Foundation.h>
@class GiftReceiveInfoModel;
NS_ASSUME_NONNULL_BEGIN
@protocol GiftAnimationDelegate <NSObject>
/**
* Returns the animation point for a given user ID in the stage view
* @param uid The user ID to get the animation point for
* @return CGPoint The point in the view's coordinate system where the animation should occur
*/
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid;
@optional
/**
* Called when a gift animation starts
* @param giftInfo The gift information model
*/
//- (void)didStartGiftAnimation:(GiftInfoModel *)giftInfo;
/**
* Called when a gift animation completes
* @param giftInfo The gift information model
*/
//- (void)didCompleteGiftAnimation:(GiftInfoModel *)giftInfo;
/**
* Called when the gift queue becomes empty
*/
- (void)didEmptyGiftQueue;
@end
@interface GiftAnimationManager : NSObject
@property (nonatomic, weak) id<GiftAnimationDelegate> delegate;
@property (nonatomic, strong) UIView *containerView;
// Configurable properties
@property (nonatomic, assign) NSTimeInterval animationInterval;
@property (nonatomic, assign) NSTimeInterval comboAnimationDelay;
@property (nonatomic, assign) NSTimeInterval standardAnimationDelay;
- (instancetype)initWithContainerView:(UIView *)containerView;
- (void)enqueueGift:(GiftReceiveInfoModel *)giftInfo;
- (void)startGiftQueue;
- (void)stopGiftQueue;
@end
NS_ASSUME_NONNULL_END