You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Create a new `MonoBehaviour` subclass and add to the same GameObject as a script.
592
+
1. Add a `UnityMessageManager` component to you scene.
593
+
- Either click `Add Component` -> `UnityMessageManager` on a GameObject in you scene.
594
+
- Or call AddComponent in a MonoBehaviour script.
595
+
`gameObject.AddComponent<UnityMessageManager>();`
580
596
581
-
3. On this new behaviour, call `GetComponent<UnityMessageManager>()` to get a `UnityMessageManager`.
597
+
2.`UnityMessageManager` only needs to be added once. It is a Singleton which can be called from any other script in the scene. Just use `UnityMessageManager.Instance`.
582
598
583
-
4. Use the method `SendMessageToFlutter` to send a string. Receive this message using the `onUnityMessage` callback of a `UnityWidget`.
584
599
600
+
3. Use the method `SendMessageToFlutter` to send a string. Receive this message using the `onUnityMessage` callback of a `UnityWidget`.
0 commit comments