Badminton-Scoreboard/Libraries/Script/Toast/Plugins/iOS/ToastPlugin.mm
2023-10-08 10:24:48 +08:00

15 lines
558 B
Plaintext

extern "C"{
#import "UIView+Toast.h"
#import "UnityAppController.h"
void _showToast(char *message, Boolean *isLong){
NSString *messageFromUnity = [NSString stringWithUTF8String:message];
UIView *displayView = [UIApplication sharedApplication].keyWindow.rootViewController.view;
if(isLong){
[displayView makeToast: messageFromUnity duration:3.5 position:CSToastPositionBottom ];
} else {
[displayView makeToast: messageFromUnity duration:2.0 position:CSToastPositionBottom ];
}
}
}