|
| 1 | +# Unity Visual Scripting |
| 2 | + |
| 3 | +The Dolby.io Unity Plugin provides nodes for Unity Visual Scripting from 2021.* version. The nodes exposes some of the functionnalities available in the .NET SDK. |
| 4 | + |
| 5 | +>**note:** You can use the plugin with Visual Scripting and C# Scripting at the same time. |
| 6 | +
|
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +The prerequisites are the same as for the [Plugin](./unity.md#prerequisites). |
| 10 | + |
| 11 | +For the visual scripting nodes to work you have to add the `DolbyIOManager` as explained in [Adding the .NET SDK to Unity](./unity.md#adding-the-net-sdk-to-unity). |
| 12 | + |
| 13 | +## The Visual Scripting Nodes |
| 14 | + |
| 15 | +Nodes are accessible in the "Add Node" contextual menu, under the DolbyIO Category: |
| 16 | + |
| 17 | +<div style="text-align:center"> |
| 18 | + <img style="padding:25px 0" src="~/images/nodes/menu.png" width="200px"> |
| 19 | +</div> |
| 20 | + |
| 21 | +### Initializing |
| 22 | + |
| 23 | +This node allows you to initialize the DolbyIO SDK and to open a session to the Dolby.io backend. |
| 24 | + |
| 25 | +<div style="text-align:center"> |
| 26 | + <img style="padding:25px 0" src="~/images/nodes/init.png" width="300px"> |
| 27 | +</div> |
| 28 | + |
| 29 | +Parameters: |
| 30 | + |
| 31 | +- **Access Token**: The access token provided by the customer's backend. See [](xref:DolbyIO.Comms.DolbyIOSDK.InitAsync(System.String,DolbyIO.Comms.RefreshTokenCallBack)). |
| 32 | +- **Participant Name**: The name of the participant. See [](xref:DolbyIO.Comms.UserInfo.Name). |
| 33 | + |
| 34 | +### Spatial Conference |
| 35 | + |
| 36 | +This node allows you to enter a spatial conference and specify the 3D Environment settings. |
| 37 | + |
| 38 | +<div style="text-align:center"> |
| 39 | + <img style="padding:25px 0" src="~/images/nodes/spatial.png" width="300px"> |
| 40 | +</div> |
| 41 | + |
| 42 | +Parameters: |
| 43 | + |
| 44 | +- **Scale, Forward, Up, Right**: Those vectors are definition for the 3D Environment you are working with. The defaults are based on the Unity Coordinates System. In most cases only the scale should be modified. See [](xref:DolbyIO.Comms.Services.ConferenceService.SetSpatialEnvironmentAsync(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3)). |
| 45 | +- **Conference Alias**: The conference alias. See [](xref:DolbyIO.Comms.Conference.Alias). |
| 46 | +- **Spatial Audio Style**: The spatial audio style, default to Shared. See [](xref:DolbyIO.Comms.SpatialAudioStyle). |
| 47 | + |
| 48 | +### Demo |
| 49 | + |
| 50 | +This node allows you to experience the demo of the Dolby.io platform. |
| 51 | + |
| 52 | +<div style="text-align:center"> |
| 53 | + <img style="padding:25px 0" src="~/images/nodes/demo.png" width="200px"> |
| 54 | +</div> |
| 55 | + |
| 56 | +Parameters: |
| 57 | + |
| 58 | +- **Scale, Forward, Up, Right**: Those vectors are definition for the 3D Environment you are working with. The defaults are based on the Unity Coordinates System. In most cases only the scale should be modified. See [](xref:DolbyIO.Comms.Services.ConferenceService.SetSpatialEnvironmentAsync(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3)). |
| 59 | +- **Spatial Audio**: Join the demo with spatial audio or not. |
| 60 | + |
| 61 | +### Mute Participant |
| 62 | + |
| 63 | +This node allows you to mute yourself or a specific participant. |
| 64 | + |
| 65 | +<div style="text-align:center"> |
| 66 | + <img style="padding:25px 0" src="~/images/nodes/mute.png" width="250px"> |
| 67 | +</div> |
| 68 | + |
| 69 | +Parameters: |
| 70 | +- **ParticipantId**: The id of the participant to mute. If no Id is provided, the node will mute the local participant. |
| 71 | +- **Muted**: The mute state to apply. |
| 72 | + |
| 73 | +### Local Player Position |
| 74 | + |
| 75 | +This node allows you to set the local player position. |
| 76 | + |
| 77 | +<div style="text-align:center"> |
| 78 | + <img style="padding:25px 0" src="~/images/nodes/local-position.png" width="250px"> |
| 79 | +</div> |
| 80 | + |
| 81 | +Parameters: |
| 82 | +- **Position**: The position of the player. See [](xref:DolbyIO.Comms.Services.ConferenceService.SetSpatialPositionAsync(System.String,System.Numerics.Vector3)) |
| 83 | +- **Direction**: The direction of the player. See [](xref:DolbyIO.Comms.Services.ConferenceService.SetSpatialDirectionAsync(System.Numerics.Vector3)) |
| 84 | + |
| 85 | +### Remote Player Position |
| 86 | + |
| 87 | +This node allows you to set the remote player position. |
| 88 | + |
| 89 | +<div style="text-align:center"> |
| 90 | + <img style="padding:25px 0" src="~/images/nodes/remote-position.png" width="250px"> |
| 91 | +</div> |
| 92 | + |
| 93 | +Parameters: |
| 94 | +- **Position**: The position of the player. See [](xref:DolbyIO.Comms.Services.ConferenceService.SetSpatialPositionAsync(System.String,System.Numerics.Vector3)) |
| 95 | + |
| 96 | + |
| 97 | +### Get Participants |
| 98 | + |
| 99 | +This node allows you to get all the participants of the conference. |
| 100 | + |
| 101 | +<div style="text-align:center"> |
| 102 | + <img style="padding:25px 0" src="~/images/nodes/participants.png" width="250px"> |
| 103 | +</div> |
| 104 | + |
| 105 | +Parameters: |
| 106 | +- **Participant Ids**: A list to filter the resulting participant list. |
| 107 | + |
| 108 | +## The Visual Scripting Events |
| 109 | + |
| 110 | +### On Conference Status Updated Event |
| 111 | + |
| 112 | +This event is emitted when the conference status has changed. See [](xref:DolbyIO.Comms.Services.ConferenceService.StatusUpdated) |
| 113 | + |
| 114 | +<div style="text-align:center"> |
| 115 | + <img style="padding:25px 0" src="~/images/nodes/event-conference-status.png" width="250px"> |
| 116 | +</div> |
| 117 | + |
| 118 | +### On Participant Added Event |
| 119 | + |
| 120 | +This event is emitted when a new participant has been added to the conference. See [](xref:DolbyIO.Comms.Services.ConferenceService.ParticipantAdded) |
| 121 | + |
| 122 | +<div style="text-align:center"> |
| 123 | + <img style="padding:25px 0" src="~/images/nodes/event-participant-added.png" width="250px"> |
| 124 | +</div> |
| 125 | + |
| 126 | +### On Participant Updated Event |
| 127 | + |
| 128 | +This event is emitted when when a conference participant has changed a status. See [](xref:DolbyIO.Comms.Services.ConferenceService.ParticipantUpdated) |
| 129 | + |
| 130 | +<div style="text-align:center"> |
| 131 | + <img style="padding:25px 0" src="~/images/nodes/event-participant-updated.png" width="250px"> |
| 132 | +</div> |
| 133 | + |
| 134 | +### On Active Speaker Change Event |
| 135 | + |
| 136 | +This event is emitted when an active speaker has changed. See [](xref:DolbyIO.Comms.Services.ConferenceService.ActiveSpeakerChange) |
| 137 | + |
| 138 | +<div style="text-align:center"> |
| 139 | + <img style="padding:25px 0" src="~/images/nodes/event-active-speaker.png" width="250px"> |
| 140 | +</div> |
| 141 | + |
| 142 | +## Examples |
| 143 | +### Joining a Conference |
| 144 | + |
| 145 | +<div style="text-align:center"> |
| 146 | + <img style="padding:25px 0" src="~/images/nodes/example-join.png" height="250px"> |
| 147 | +</div> |
| 148 | + |
| 149 | +### Updating the local player position |
| 150 | + |
| 151 | +<div style="text-align:center"> |
| 152 | + <img style="padding:25px 0" src="~/images/nodes/example-position.png" height="500px"> |
| 153 | +</div> |
0 commit comments