Skip to content

Commit 41ccc73

Browse files
committed
Handle icon and image in the readme that are broken on pub.dev.
1 parent 93cbb6d commit 41ccc73

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You will need to open and export a Unity project, even for running the example.
6262

6363
## Setup
6464

65-
In the tutorial below, there are steps specific to each platform, denoted by a :information_source: icon followed by
65+
In the tutorial below, there are steps specific to each platform, denoted by a ℹ️ icon followed by
6666
the platform name (Android or iOS). You can click on its icon to expand it.
6767

6868
### Prerequisites
@@ -142,7 +142,7 @@ After exporting Unity, you will need to make some small changes in your iOS or A
142142
You will likely need to do this **only once**. These changes remain on future Unity exports.
143143

144144
<details>
145-
<summary>:information_source: <b>Android</b></summary>
145+
<summary>ℹ️ <b>Android</b></summary>
146146

147147
1. Setting the Android NDK
148148

@@ -323,7 +323,7 @@ allprojects {
323323

324324

325325
<details>
326-
<summary>:information_source: <b>iOS</b></summary>
326+
<summary>ℹ️ <b>iOS</b></summary>
327327

328328
> Because of Apple's privacy manifest requirements, you need a minimal Unity version of 2021.3.35 or 2022.3.18 to publish an app.
329329
@@ -396,7 +396,7 @@ allprojects {
396396

397397

398398
<details>
399-
<summary>:information_source: <b>AR Foundation Android</b></summary>
399+
<summary>ℹ️ <b>AR Foundation Android</b></summary>
400400

401401
1. Check the version of the `XR Plugin Management` in the Unity package manager. Versions `4.3.1 - 4.3.3` contain a bug that breaks Android exports.
402402
Make sure to use a version <=`4.2.2` or >=`4.4`.
@@ -425,7 +425,7 @@ allprojects {
425425
</details>
426426
427427
<details>
428-
<summary>:information_source: <b>AR Foundation iOS</b></summary>
428+
<summary>ℹ️ <b>AR Foundation iOS</b></summary>
429429
430430
1. Open the *ios/Runner/Info.plist* and add a camera usage description.
431431
For example:
@@ -439,7 +439,7 @@ For example:
439439
</details>
440440

441441
<details>
442-
<summary>:information_source: <b>Vuforia Android</b></summary>
442+
<summary>ℹ️ <b>Vuforia Android</b></summary>
443443

444444
1. Your export should contain a Vuforia library in the `android/unityLibrary/libs/` folder. Currently named `VuforiaEngine.aar`.
445445

@@ -452,7 +452,7 @@ In case this gets outdated or broken, check the [Vuforia documentation](https://
452452
</details>
453453

454454
<details>
455-
<summary>:information_source: <b>Vuforia iOS</b></summary>
455+
<summary>ℹ️ <b>Vuforia iOS</b></summary>
456456

457457
These steps are based on these [Vuforia docs](https://developer.vuforia.com/library/unity-extension/using-vuforia-engine-unity-library-uaal#ios-specific-steps) and [this comment](https://github.com/juicycleff/flutter-unity-view-widget/issues/314#issuecomment-785302253)
458458

@@ -486,7 +486,7 @@ We recommend using a physical iOS or Android device, as emulator support is limi
486486
Below are the limited options to use an emulator.
487487

488488
<details>
489-
<summary> <b>iOS Simulators</b> </summary>
489+
<summary>ℹ️ <b>iOS Simulators</b> </summary>
490490

491491
The `Target SDK` option in the Unity player settings is important here.
492492
- `Device SDK` exports an ARM build. (Which does **NOT** work on ARM simulators)
@@ -530,7 +530,7 @@ The rest depends on the type of processor in your mac:
530530
</details>
531531

532532
<details>
533-
<summary> <b>Android emulators</b></summary>
533+
<summary>ℹ️ <b>Android emulators</b></summary>
534534

535535
Unity only supports ARM build targets for Android. However most Android emulators are x86 which means they simply won't work.
536536

@@ -570,19 +570,40 @@ If you computer does not have an ARM processor, like most computers running on I
570570

571571
2. Use the method `postMessage` to send a string, using the GameObject name and the name of a behaviour method that should be called.
572572

573+
```dart
574+
// Snippet of postMessage usage in the example project.
575+
_unityWidgetController?.postMessage(
576+
'Cube', // GameObject name
577+
'SetRotationSpeed', // Function name in attached C# script
578+
speed, // Function parameter (string)
579+
);
580+
```
573581
### Unity-Flutter
574582

575583
1. Select the GameObject that should execute the communication and go to **Inspector > Add Component > Unity Message Manager**.
576584

577-
<img src="https://i.stack.imgur.com/1gSOy.png" width="400" />
578-
579585
2. Create a new `MonoBehaviour` subclass and add to the same GameObject as a script.
580586

581587
3. On this new behaviour, call `GetComponent<UnityMessageManager>()` to get a `UnityMessageManager`.
582588

583589
4. Use the method `SendMessageToFlutter` to send a string. Receive this message using the `onUnityMessage` callback of a `UnityWidget`.
584590

585591

592+
```C#
593+
// Send a basic string to Flutter
594+
SendMessageToFlutter("Hello there!");
595+
```
596+
```C#
597+
// If you want to send multiple parameters or objects, use a JSON string.
598+
// This is a random object serialized to JSON using Json.net.
599+
JObject o = JObject.FromObject(new
600+
{
601+
id = 1,
602+
name = "Object 1",
603+
whatever = 12
604+
});
605+
SendMessageToFlutter(o.ToString());
606+
```
586607

587608

588609
## Examples

0 commit comments

Comments
 (0)