Unitysendmessage



Apr 13th, 2021
Never

NSString. aString = NSString alloc initWithString: @'a string'; UnitySendMessage('MyObject', 'Method', aString UTF8String); But I am wondering how the memory allocation works across the message passing, I guess I have to do allocation (most examples do), but is the UnitySendMessage synchronous. UnityPlayer.UnitySendMessage is a void function and does not return a value. Take a look at the UnitySendMessageExtension function implementation below. It is similar to turnipinindia's answer but it returns a value. It only returns a string so you have to convert that string to.

Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
Unity ios native plugin
  1. if(value.startsWith('dm;')){
  2. // IT'S A DIRECT MESSAGE
  3. // Recording is started
  4. setRecording(record)
  5. }
  6. val recordingData = Gson().fromJson(recordingJson, RecordingVideocall::class.java)
  7. viewModel.registrationEnabled=when(recordingData.action){
  8. sendPrivateMessage('recordStarted')
  9. RecordingVideocall.ACTION_STOP->{
  10. }
  11. }
  12. UnityPlayer.UnitySendMessage(
  13. 'NotifyRecording',
  14. }
  15. privatefun sendPrivateMessage(message:String){
  16. UnityPlayer.UnitySendMessage(
  17. )
RAW Paste Data

Unity Ios Plugin