Skip to content

Commit

Permalink
Release/v0.2.1 (#6)
Browse files Browse the repository at this point in the history
<!-- Copy the TICKETID for this task from Monday and add it to the PR
name in brackets -->
<!-- PR name should look like: [TICKETID] My Pull Request -->

<!-- Add link for the ticket here editing the TICKETID-->

## [SDK-524](https://ready-player-me.atlassian.net/browse/SDK-524)

## Description

-   Multimesh support updates

<!-- Fill the section below with Added, Updated and Removed. -->
<!-- If there is no item under one of the lists remove it's title. -->

<!-- Testability -->

## How to Test

-  Import the release branch into a RPM Unity project and run the sample

<!-- Update your progress with the task here -->

## Checklist

-   [x] Tests are written and are passing
-   [ ] Documentation is updated.
- [x] Changelog is updated


[SDK-524]:
https://ready-player-me.atlassian.net/browse/SDK-524?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Harrison Hough <[email protected]>
Co-authored-by: Robin <[email protected]>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent d2ecf96 commit 0cead02
Show file tree
Hide file tree
Showing 77 changed files with 308 additions and 138,697 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @readyplayerme/onboarding-integrations be requested for
# review when someone opens a pull request.
* @readyplayerme/onboarding-integrations
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Files**

Attach or link to .glb files or avatar URL that trigger the bug.

In addition, make sure to run those files through the example scenes first. If you encounter errors or warnings, try to make sure they are not responsible for the issue.

> Note: You have to ZIP archive them first in order for GitHub to accept the upload.
If your files are confidential:

- Try to create a similar, but intellectual-property-free Unity example project or build that reproduces the bug in the same way (so any community member can have a look)
- Otherwise, still create this issue and send the files (or a link to them) discretely via email

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Ready Player Me Core version
- Ready Player Me WebView version (If relevant)
- glTFast version
- Unity Editor version [e.g. 2021.2.1f1]
- Render Pipeline and version [e.g. Universal Render Pipeline 12.0]
- Operating System [e.g. Windows, Mac, Linux ]
- Platform: [e.g. Editor , Windows Player, iOS]

additionally (if significant for the bug):

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- For WebGL: Browser [e.g. stock browser, safari]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. e.g. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 9 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copy the TICKETID for this task from Monday and add it to the PR name in brackets -->
<!-- Copy the TICKETID for this task from Jira and add it to the PR name in brackets -->
<!-- PR name should look like: [TICKETID] My Pull Request -->

<!-- Add link for the ticket here editing the TICKETID-->
Expand All @@ -9,7 +9,7 @@

- Briefly describe what this change will do

<!-- Fill the section below with Added, Updated and Removed. -->
<!-- Fill the section below with Added, Updated and Removed information. -->
<!-- If there is no item under one of the lists remove it's title. -->

<!-- Testability -->
Expand All @@ -22,4 +22,11 @@

## Checklist

- [ ] Tests written or updated for the changes.
- [ ] Documentation is updated.
- [ ] Changelog is updated.

<!--- Remember to copy the Changes Section into the commit message when you close the PR -->



3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ sysinfo.txt
# Crashlytics generated file
crashlytics-build.properties

# Samples meta files
**/Samples~.meta
**/Samples.meta
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.2.1] - 2024.MM.DD

### Updated
- Netcode Character Prefab updated with multimesh support
- Netcode PLayer script transfers meshes

### Fixed
- Variable name typos

### Removed
- Figtihng Game Sample removed

## [0.2.0] - 2023.08.14

### Added
Expand Down
38 changes: 38 additions & 0 deletions Editor/DependencyInstaller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using ReadyPlayerMe.Core.Editor;
using UnityEditor;

public abstract class DependencyInstaller
{
private const string NETCODE_SUPPORT_PACKAGE_NAME = "com.readyplayerme.netcodesupport";
private const string NETCODE_HELPER_PACKAGE = "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#main";
private const string DIALOG_MESSAGE = "This package depends on - com.unity.multiplayer.samples.coop. Do you want to install it?";

[InitializeOnLoadMethod]
private static void Initialize()
{
PackageManagerEventListener.OnPackageImported += OnPackageImported;
}

~DependencyInstaller()
{
PackageManagerEventListener.OnPackageImported -= OnPackageImported;
}

private static void OnPackageImported(string packageName)
{
if (packageName != NETCODE_SUPPORT_PACKAGE_NAME)
{
return;
}

if (PackageManagerHelper.IsPackageInstalled(NETCODE_HELPER_PACKAGE))
{
return;
}

if (EditorUtility.DisplayDialog("Ready Player Me", DIALOG_MESSAGE, "OK", "Cancel"))
{
PackageManagerHelper.AddPackage(NETCODE_HELPER_PACKAGE);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Editor/ReadyPlayerMe.NetcodeSupport.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "ReadyPlayerMe.NetcodeSupport.Editor",
"rootNamespace": "",
"references": [],
"references": [
"ReadyPlayerMe.Core.Editor"
],
"includePlatforms": [
"Editor"
],
Expand Down
19 changes: 10 additions & 9 deletions Editor/TransferPrefab.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
using ReadyPlayerMe.Core.Editor;
using UnityEditor;
using UnityEngine;

namespace ReadyPlayerMe.NetcodeSupport.Editor
{
public static class TransferPrefab
{
[MenuItem("Ready Player Me/Transfer Netcode Prefab")]
private const string NEW_PREFAB_PATH = "Assets/Ready Player Me/Resources/RPM_Netcode_Character.prefab";
private const string PREFAB_ASSET_NAME = "t:prefab RPM_Netcode_Character";

[MenuItem("Ready Player Me/Transfer Netcode Prefab", priority = 34)]
public static void Transfer()
{
string[] guids = AssetDatabase.FindAssets("t:prefab RPM_Netcode_Character");
var guids = AssetDatabase.FindAssets(PREFAB_ASSET_NAME);

if (guids.Length == 0)
{
Debug.Log("RPM_Netcode_Character prefab not found. Please reimport Netcode Support package.");
}
else
{
if (AssetDatabase.LoadAssetAtPath("Assets/Ready Player Me/Resources/RPM_Character.prefab", typeof(GameObject)))
if (AssetDatabase.LoadAssetAtPath(NEW_PREFAB_PATH, typeof(GameObject)))
{
if (!EditorUtility.DisplayDialog("Warning", "RPM_Character prefab already exists. Do you want to overwrite it?", "Yes", "No"))
if (!EditorUtility.DisplayDialog("Warning", "RPM_Netcode_Character prefab already exists. Do you want to overwrite it?", "Yes", "No"))
{
return;
}
}

string path = AssetDatabase.GUIDToAssetPath(guids[0]);
AssetDatabase.CopyAsset(path, "Assets/Ready Player Me/Resources/RPM_Character.prefab");
Selection.activeObject = AssetDatabase.LoadAssetAtPath("Assets/Ready Player Me/Resources/RPM_Character.prefab", typeof(GameObject));
Debug.Log("Netcode prefab transferred to Assets/Ready Player Me/Resources/RPM_Character.prefab");
PrefabHelper.TransferPrefabByGuid(guids[0], NEW_PREFAB_PATH);
Debug.Log($"Netcode prefab transferred to {NEW_PREFAB_PATH}");
}
}
}
Expand Down
29 changes: 9 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@

This provides support for loading RPM avatar in a multiplayer application using [Netcode](https://unity.com/products/netcode) and [Ready Player Me Unity SDK](https://github.com/readyplayerme/rpm-unity-sdk-core). This can be used as a reference for anyone wanting to use Ready Player Me Unity SDK to create a multiplayer using Unity Netcode. It also provides a working samples:
- Avatar Control - It showcases how to have a simple controls for avatar in a multiplayer game.
- Basic Fighting Game - It showcases a rudimentary PvP fighting game (e.g., Street Fighter, Tekken).

> Note: These sample doesn't contain a completed games but rather a working example of a very basic multiplayer.
## Requirements
- Unity Version 2021.3 or higher
- [Ready Player Me Core](https://github.com/readyplayerme/rpm-unity-sdk-core) - v1.2.0
- [Ready Player Me Avatar Loader](https://github.com/readyplayerme/rpm-unity-sdk-avatar-loader) - v1.2.0
- [Ready Player Me WebView](https://github.com/readyplayerme/rpm-unity-sdk-webview) - v1.1.1
- [glTFast](https://github.com/atteneder/glTFast) - v5.0.0
- [Ready Player Me Core](https://github.com/readyplayerme/rpm-unity-sdk-core) - v4.0.0+
- [Ready Player Me WebView](https://github.com/readyplayerme/rpm-unity-sdk-webview) - v2.0.0
- [glTFast](https://github.com/atteneder/glTFast) - v5.0.0+
- [Multiplayer Samples Coop](https://docs-multiplayer.unity3d.com/netcode/current/components/networktransform/#owner-authoritative-mode) - main

### Dependencies included in package
- Netcode for Gameobjects - v1.4.0
- Multiplayer Tools - v1.1.0
- Netcode for GameObjects - v1.4.0
- [Multiplayer Tools](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#main) - v1.1.0

## Installation
- Copy git URL by clicking on green Code button and then by clicking on copy button as shown.
Expand All @@ -34,9 +32,9 @@ This provides support for loading RPM avatar in a multiplayer application using
- After package installed you should see it under Ready Player Me block.

<img width="500" alt="image" src="https://github.com/readyplayerme/rpm-unity-sdk-netcode-support/assets/1121080/7f9620cd-40aa-4d9a-92ab-090607782558">

- To get support for [Client Network Transform](https://docs-multiplayer.unity3d.com/netcode/current/components/networktransform/#owner-authoritative-mode) a package has to be installed manually.
Copy the following url and past in `Add package from git URL` window in package manager.
- After installation you will see a popup to import an assisting package to get support for [Client Network Transform](https://docs-multiplayer.unity3d.com/netcode/current/components/networktransform/#owner-authoritative-mode). Select ok to import the package.
- For installing the package manually, copy the following url and past in `Add package from git URL` window in package manager.
```
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#main
```
Expand All @@ -51,18 +49,9 @@ This provides support for loading RPM avatar in a multiplayer application using
- Run the scene, paste your avatar URL and click on start button.
- Build the scene and run it on another device to observe multiple avatars in the same scene.<br>
<img width="500" alt="image" src="https://github.com/readyplayerme/rpm-unity-sdk-netcode-support/assets/1121080/5bcbf2a0-e113-403c-9327-18d8f5e14288">
### Simple Figthing Game
- Select Ready Player Me Netcode Support in Package manager and import the Basic Fighting Game sample.
<img width="500" alt="image" src="https://github.com/readyplayerme/rpm-unity-sdk-netcode-support/assets/1121080/79401c2a-40e6-44d3-ac71-ceefda3252cd">
- Open the menu scene.<br>
<img width="500" alt="image" src="https://github.com/readyplayerme/rpm-unity-sdk-netcode-support/assets/1121080/c53ee18b-3e64-4534-82e1-ae05aabf1736">
- Add menu and game scene to build settings.
- Run the scene, paste your avatar URL, add name and click on start button.
- Build the scene and run it on another device to observe multiple avatars in the same scene.<br>
<img width="500" alt="image" src="https://github.com/readyplayerme/rpm-unity-sdk-netcode-support/assets/1121080/f00706c4-51af-4626-8b05-e4b56cd0ea5c">

## Netcode API Used
#### [Network Mananger](https://docs-multiplayer.unity3d.com/netcode/current/components/networkmanager/)
#### [Network Manager](https://docs-multiplayer.unity3d.com/netcode/current/components/networkmanager/)
- Used for starting as host, server, or client.
- Provides API for checking if isHost, isOwner, and isClient.
- For spawning player and fireball.
Expand Down
Loading

0 comments on commit 0cead02

Please sign in to comment.