Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit d52c919

Browse files
authored
70 implement nodes for unity visual scripting (#78)
* Unity Visual Scripting Nodes * Added Mute Node and updated conference ones * Added Node Event for Conference StatusUpdated * Documentation for visual scripting nodes * Cleaned various typos, and enhancement * Fix for windows copy files
1 parent 35e034f commit d52c919

37 files changed

+898
-10
lines changed

cmake/package.json.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "dolbyio.comms.sdk",
33
"version": "${PROJECT_VERSION}",
4-
"displayName": "DolbyIO .NET Sdk",
5-
"description": "The DolbyIO .NET Sdk",
4+
"unity": "2021.1",
5+
"displayName": "DolbyIO .NET SDK",
6+
"description": "The DolbyIO .NET SDK",
67
"documentationUrl": "https://api-references.dolby.io/comms-sdk-dotnet/documentation/index.html",
78
"licensesUrl": "https://github.com/DolbyIO/comms-sdk-dotnet/blob/main/LICENSE",
89
"dependencies": {

cmake/unity.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ if (BUILD_UNITY)
55

66
configure_file(cmake/package.json.in ${UNITY_RUNTIME_DIRECTORY}/package.json)
77

8+
file(GLOB UNIT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/Units/*.cs)
9+
10+
foreach(file IN LISTS UNIT_SOURCES)
11+
list(APPEND COPY_COMMANDS
12+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${file} ${UNITY_RUNTIME_DIRECTORY}/Runtime/Units/
13+
)
14+
endforeach()
15+
816
add_custom_target(UnityPackage ALL
917
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:DolbyioComms::sdk> "${UNITY_RUNTIME_DIRECTORY}/Runtime/$<TARGET_FILE_NAME:DolbyioComms::sdk>"
1018
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:DolbyioComms::media> "${UNITY_RUNTIME_DIRECTORY}/Runtime/$<TARGET_FILE_NAME:DolbyioComms::media>"
@@ -15,7 +23,11 @@ if (BUILD_UNITY)
1523
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/scripts/dolbyio.comms.asmdef "${UNITY_RUNTIME_DIRECTORY}/Runtime/dolbyio.comms.asmdef"
1624
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/scripts/VectorExtension.cs "${UNITY_RUNTIME_DIRECTORY}/Runtime/Extensions/VectorExtension.cs"
1725
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/scripts/DolbyIOManager.cs "${UNITY_RUNTIME_DIRECTORY}/Runtime/Components/DolbyIOManager.cs"
26+
# Visual Scripting Units
27+
COMMAND ${CMAKE_COMMAND} -E make_directory "${UNITY_RUNTIME_DIRECTORY}/Runtime/Units/"
1828

29+
${COPY_COMMANDS}
30+
1931
DEPENDS DolbyIO.Comms.Native DolbyIO.Comms.Sdk
2032
)
2133
endif()

docs/documentation/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
href: started.md
55
- name: Unity Plugin
66
href: unity.md
7+
- name: Unity Visual Scripting
8+
href: visualscripting.md
79
- name: Api Reference
810
href: api/toc.yml
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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>

docs/images/nodes/demo.png

35.7 KB
Loading
22.6 KB
Loading
21.5 KB
Loading
19.7 KB
Loading
20.1 KB
Loading

docs/images/nodes/example-join.png

118 KB
Loading

0 commit comments

Comments
 (0)