void sendUnityMessage(const char* pMsg) { #ifdef __cplusplus if (pUnityMethod && pUnityObject) UnitySendMessage(pUnityObject, pUnityMethod, pMsg); #endif if (pOutputCallback) pOutputCallback(pMsg); }
void testFunction() { printf("Hello Out There!"); UnitySendMessage("Cube", "setMyTexty", "I come from C"); }
std::string sendMessageToUnity(int type, std::string msg){ char param[64] = {0}; sprintf(param, "%d,%s", type, msg.c_str()); UnitySendMessage("MetaUnity", "invokeCallback", param); return ""; }