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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+36-23Lines changed: 36 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,22 @@
1
1
# How to Contribute
2
2
3
3
## Local Setup
4
-
Setting up the project locally is similar to any other Unity project:
4
+
5
+
### Unity-only (most contributors)
6
+
Use this if you are only editing C# code, assets, samples, or tests.
5
7
1. Ensure you have [Unity 2022.3.23f1](https://unity.com/releases/editor/whats-new/2022.3.23) installed.
6
-
2. Install [NodeJS](https://nodejs.org/en) on your system.
7
-
3. Fork the repository and clone it to your local drive.
8
-
4. To build the plugin, run these commands in your terminal:
8
+
2. Fork the repository and clone it to your local drive.
9
+
10
+
### JS bridge (only if you change the WebGL plugin)
11
+
Node.js is only required to rebuild the WebGL JS bridge. The build step installs the upstream JS SDK and generates the `.jslib`/`.jspre` files used by Unity.
12
+
1. Install [NodeJS](https://nodejs.org/en) on your system.
13
+
2. Build the JS bridge:
9
14
```shell
10
15
cd Tools/playroomkit-js
11
16
npm install
12
17
```
13
-
This command will install the `upstream.sdk`and its dependencies. It also creates a `Playroom` folder inside `Assets/Plugins`, containing two files: a `.JSLIB` file and a `.JSPRE` file.
14
-
5. Complete your setup by running `npm install`whenever changes are made to `Playroomkit/src/index.js`.
18
+
This installs the upstream SDK and builds the WebGL plugin into `Packages/com.playroomkit.sdk/Runtime/Plugins/Playroom` (the `.jslib`and `.jspre` files).
19
+
3. Re-run `npm install`(or `npm run build`) only when `Tools/playroomkit-js/src/index.js` changes.
@@ -39,30 +44,25 @@ To implement a new feature available in the upstream SDK:
39
44
The process for implementing fixes from the upstream SDK mirrors other feature implementations, typically done within the `index.js` file.
40
45
41
46
### Architecture
42
-
This package follows this folder structure:
47
+
This package follows this folder structure (UPM layout):
43
48
```
44
-
PlayroomKit
45
-
├── dependencies/
49
+
Packages/com.playroomkit.sdk
50
+
├── Assets/
46
51
├── Editor/
47
-
├── Examples/
48
-
├── modules/
49
-
├── node_modules/
50
-
├── Prefabs/
51
-
├── src/
52
-
└── Tests/
53
-
└── package.json
54
-
└── package-lock.json
55
-
└── Playroom.asmdef
56
-
└── PlayroomKit.cs
57
-
└── vite.config.js
52
+
├── Runtime/
53
+
├── Samples~/
54
+
├── Tests/
55
+
├── package.json
56
+
├── Playroom.asmdef
57
+
└── PlayroomKit.cs
58
58
```
59
-
The package also includes a custom WebGL template for Discord activities located in `Assets/WebGLTemplates`.
59
+
The package also includes a custom WebGL template for Discord activities located in `Packages/com.playroomkit.sdk/Assets/WebGLTemplates`.
60
60
61
61
#### Modules
62
62
Playroomkit comes with many [modules](https://docs.joinplayroom.com/components) which help with speeding up development. Unity SDK builds on top of that and adds its own modules such as MockMode.
63
63
The folder structure is something like this:
64
64
```
65
-
modules
65
+
Packages/com.playroomkit.sdk/Runtime/modules
66
66
├── Helpers/
67
67
├── Interfaces/
68
68
├── MockMode/
@@ -85,4 +85,17 @@ modules
85
85
-**PlayroomkitDevManager.cs**: Manager script for choosing between local and browser mockmode, this is used in the `PlayroomMockManager` prefab.
86
86
87
87
## Tests
88
-
Tests are located in the `Playroomkit/Tests` folder and are currently editor-only. Install Unity Test Runner to execute tests via the `Window/General/Test Runner` menu.
88
+
Tests are located in `Packages/com.playroomkit.sdk/Tests/Editor` and are currently editor-only. Install Unity Test Runner to execute tests via the `Window/General/Test Runner` menu.
89
+
90
+
## Samples
91
+
Samples are distributed via the package and must be imported into your project to run them.
92
+
1. Open `Window > Package Manager`.
93
+
2. Select `PlayroomKit` in the list.
94
+
3. In the `Samples` section, click `Import` on the sample you want to run.
95
+
4. Open the imported sample scene from your project `Assets/` folder.
96
+
97
+
### Syncing sample changes
98
+
If the package sample content changes, re-import the sample from the same Package Manager screen (`Samples` section > `Reimport`).
99
+
100
+
Do not edit the imported sample directly in `Assets/` if you want changes to persist upstream. The imported copy is not merged back into the package. If you must tweak something in an imported sample, also apply the same changes to the source sample under `Packages/com.playroomkit.sdk/Samples~` (or manually replace the updated files in the package sample).
Copy file name to clipboardExpand all lines: README.md
+5-11Lines changed: 5 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ This SDK is a wrapper over PlayroomKit JS. Currently, it only supports WebGL exp
20
20
21
21
See [PlayroomKit Unity docs](https://docs.joinplayroom.com/usage/unity) on how to use this SDK in your Unity project.
22
22
23
+
The SDK is distributed as a UPM package (not a `.unitypackage`). Source lives under `Packages/com.playroomkit.sdk`, and samples are under `Packages/com.playroomkit.sdk/Samples~`.
23
24
24
25
This beta version of the SDK might undergo changes that could break compatibility with previous versions, even without a major version update. To ensure stability, it's advisable to fix the usage to a particular package version. By doing so, you'll consistently install the same version and avoid unexpected changes, unless you deliberately seek the latest updates.
25
26
@@ -32,28 +33,21 @@ This beta version of the SDK might undergo changes that could break compatibilit
32
33
33
34
You can search for help, or ask the community, in our [Discord channel](https://discord.gg/HGkSRAD8).
34
35
35
-
Found a bug, or want us to implement something? [Create an Issue](https://github.com/asadm/playroom-unity/issues/new) on GitHub.
36
+
Found a bug, or want us to implement something? [Create an Issue](https://github.com/playroomkit/unity/issues/new) on GitHub.
36
37
37
38
### Creating a new release
38
39
39
-
Tag and push the tag to create a new release. The tag should be in the format `v0.Y.Z`. For example, `v0.0.20`.
40
-
41
-
```bash
42
-
git tag v0.Y.Z
43
-
git push origin --tags
44
-
```
45
-
46
-
This will create a draft release [on GitHub](https://github.com/asadm/playroom-unity/releases). Edit the release to add release notes and publish it.
40
+
Releases are handled by release-please. Merges to `main` create or update a release PR; merging that PR cuts the tag, updates `CHANGELOG.md`, and publishes the GitHub release (the workflow also attaches the packed UPM artifact).
47
41
48
42
### Contribute code to this project
49
43
50
44
Read [CONTRIBUTING.md](./CONTRIBUTING.md) for more information on how to contribute code to this project.
51
45
52
46
### Examples
53
47
54
-
Example(s) of the SDK are in the [Examples](https://github.com/asadm/playroom-unity/tree/main/Assets/PlayroomKit/Examples) folder
48
+
Example(s) of the SDK are in the [Samples](https://github.com/playroomkit/unity/tree/main/Packages/com.playroomkit.sdk/Samples~) folder
55
49
56
50
<!-- End SDK Contribution -->
57
51
58
52
### Limitations
59
-
Currently, there's no support for using the native platforms. We'd love to hear ideas and plans to implement PlayroomKit for Unity on native platforms. Please join [this Discord](https://discord.gg/uDHxeRYhRe) to discuss!
53
+
Currently, there's no support for using the native platforms. We'd love to hear ideas and plans to implement PlayroomKit for Unity on native platforms. Please join [this Discord](https://discord.gg/uDHxeRYhRe) to discuss!
0 commit comments