2019-03-26 17:06:17 -04:00
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
#ifndef UnityUtils_h
|
|
|
|
#define UnityUtils_h
|
|
|
|
|
2019-03-26 17:06:17 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
void InitArgs(int argc, char* argv[]);
|
2019-03-26 17:06:17 -04:00
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
bool UnityIsInited(void);
|
2019-03-26 17:06:17 -04:00
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
void InitUnity();
|
2019-03-26 17:06:17 -04:00
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
void UnityPostMessage(NSString* gameObject, NSString* methodName, NSString* message);
|
2019-03-26 17:06:17 -04:00
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
void UnityPauseCommand();
|
2019-03-26 17:06:17 -04:00
|
|
|
|
2019-08-01 04:43:34 -04:00
|
|
|
void UnityResumeCommand();
|
2019-03-26 17:06:17 -04:00
|
|
|
|
|
|
|
#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-08-01 04:43:34 -04:00
|
|
|
#endif /* UnityUtils_h */
|