Badminton-Scoreboard/Libraries/Script/Toast/Plugins/iOS/ToastPlugin.mm

15 lines
558 B
Plaintext
Raw Normal View History

2023-10-08 02:24:48 +00:00
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 ];
}
}
}