This repository has been archived on 2020-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
2019-03-26 17:05:53 -04:00
|
|
|
//
|
|
|
|
// Created by rex on 15/03/2019.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef FLUTTER_UNITY_WIDGET_UNITYUTILS_H
|
|
|
|
#define FLUTTER_UNITY_WIDGET_UNITYUTILS_H
|
|
|
|
|
2019-03-26 17:06:17 -04:00
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void InitArgs(int argc, char* argv[]);
|
|
|
|
|
|
|
|
bool UnityIsInited(void);
|
|
|
|
|
|
|
|
void InitUnity();
|
|
|
|
|
|
|
|
void UnityPostMessage(NSString* gameObject, NSString* methodName, NSString* message);
|
|
|
|
|
|
|
|
void UnityPauseCommand();
|
|
|
|
|
|
|
|
void UnityResumeCommand();
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@protocol UnityEventListener <NSObject>
|
|
|
|
- (void)onMessage:(NSString *)message;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface UnityUtils : NSObject
|
|
|
|
|
|
|
|
+ (BOOL)isUnityReady;
|
|
|
|
+ (void)createPlayer:(void (^)(void))completed;
|
|
|
|
+ (void)addUnityEventListener:(id<UnityEventListener>)listener;
|
|
|
|
+ (void)removeUnityEventListener:(id<UnityEventListener>)listener;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2019-03-26 17:05:53 -04:00
|
|
|
#endif //FLUTTER_UNITY_WIDGET_UNITYUTILS_H
|
2019-03-26 17:06:17 -04:00
|
|
|
|