Skip to content

Commit 75623c9

Browse files
committed
Merge branch 'release/v3.2.2' into main
2 parents 79a4ed8 + 4a35072 commit 75623c9

17 files changed

+284
-72
lines changed

.github/latest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
## Changelog
33

44
### Fixed
5-
- issue of missing mesh references when prefabs were created by avatar loader window
5+
- an issue with module installer causing errors when importing on some Windows machines by @rYuuk in [#117](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/117)
6+
67

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Run Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- release/*
9+
jobs:
10+
runAllTests:
11+
name: ${{ matrix.unityVersion }} integration tests
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
testMode:
18+
- editmode
19+
unityVersion:
20+
- 2020.3.0f1
21+
steps:
22+
- name: Checkout empty unity project repository
23+
uses: actions/checkout@v3
24+
with:
25+
repository: "readyplayerme/rpm-unity-empty-project"
26+
fetch-depth: 0
27+
ref: main
28+
token: ${{ secrets.DEV_SDK_TOKEN }}
29+
- name: Cache Project
30+
uses: actions/cache@v3
31+
with:
32+
path: Library
33+
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
34+
restore-keys: |
35+
Library-
36+
- name: Get npm
37+
uses: actions/setup-node@v3
38+
with:
39+
node-version: 18
40+
- name: Install openupm-cli
41+
run: npm install -g openupm-cli
42+
- name: Add core with current branch as package
43+
run: openupm add com.readyplayerme.core@https://github.com/readyplayerme/rpm-unity-sdk-core.git#${GITHUB_REF##*/}
44+
- name: Run Tests
45+
uses: game-ci/unity-test-runner@v2
46+
env:
47+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
48+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
49+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
50+
with:
51+
unityVersion: ${{ matrix.unityVersion }}
52+
testMode: ${{ matrix.testMode }}
53+
projectPath: ${{ matrix.projectPath }}
54+
checkName: ${{ matrix.unityVersion }} ${{ matrix.testMode }} tests result
55+
githubToken: ${{ secrets.GITHUB_TOKEN }}
56+
coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ sysinfo.txt
5858
# Crashlytics generated file
5959
crashlytics-build.properties
6060

61+
62+
.idea/

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [3.2.2] - 2023.09.07
7+
8+
### Fixed
9+
- an issue with module installer causing errors when importing on some Windows machines by @rYuuk in [#117](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/117)
10+
611
## [3.2.1] - 2023.08.28
712

813
### Fixed
9-
- issue of missing mesh references when prefabs were created by avatar loader window
14+
- issue of missing mesh references when prefabs were created by avatar loader window by @harrisonhough in [#109](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/109)
1015

1116
## [3.2.0] - 2023.08.24
1217

Editor/EditorAssetGenerator.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ public class EditorAssetGenerator
1111

1212
static EditorAssetGenerator()
1313
{
14-
if (!Resources.Load<AvatarLoaderSettings>(AvatarLoaderSettings.SETTINGS_PATH))
15-
{
16-
CreateSettingsAssets();
17-
}
14+
EditorApplication.delayCall += CreateSettingsAssets;
15+
}
16+
17+
~EditorAssetGenerator()
18+
{
19+
EditorApplication.delayCall -= CreateSettingsAssets;
1820
}
1921

2022
private static void CreateSettingsAssets()

Editor/Module Management/ModuleInstaller.cs

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading;
5-
using Unity.CodeEditor;
65
using UnityEditor;
76
using UnityEditor.Compilation;
87
using UnityEditor.PackageManager;
@@ -23,9 +22,10 @@ public static class ModuleInstaller
2322

2423
private const int THREAD_SLEEP_TIME = 100;
2524
private const string PROGRESS_BAR_TITLE = "Ready Player Me";
26-
private const string READY_PLAYER_ME_SYMBOL = "READY_PLAYER_ME";
2725
private const string GLTFAST_SYMBOL = "GLTFAST";
26+
private const string READY_PLAYER_ME_SYMBOL = "READY_PLAYER_ME";
2827
private const string CORE_MODULE_NAME = "com.readyplayerme.core";
28+
private const string GLTFAST_NAME = "com.atteneder.gltfast";
2929

3030
private const string MODULE_INSTALLATION_SUCCESS_MESSAGE =
3131
"All the modules are installed successfully. Ready Player Me avatar system is ready to use.";
@@ -36,51 +36,33 @@ public static class ModuleInstaller
3636
private const float TIMEOUT_FOR_MODULE_INSTALLATION = 20f;
3737
private const string AVATAR_LOADER_SUBSTRING = "avatarloader";
3838

39+
private static bool modulesInstalled;
3940

4041
static ModuleInstaller()
4142
{
42-
#if !GLTFAST
43-
AddGltfastSymbol();
44-
#endif
45-
Events.registeredPackages += OnRegisteredPackages;
46-
Events.registeringPackages += OnRegisteringPackages;
47-
}
48-
49-
50-
/// <summary>
51-
/// Called when a package is added, removed or changed.
52-
/// </summary>
53-
/// <param name="args">Describes the <c>PackageInfo</c> entries of packages that have just been registered.</param>
54-
private static void OnRegisteredPackages(PackageRegistrationEventArgs args)
55-
{
56-
Events.registeredPackages -= OnRegisteredPackages;
57-
#if RPM_DEVELOPMENT
58-
return;
43+
# if RPM_DEVELOPMENT
44+
modulesInstalled = true;
5945
#endif
60-
// Core Module installed
61-
if (args.added != null && args.added.Any(p => p.name == CORE_MODULE_NAME))
46+
if (!modulesInstalled)
6247
{
6348
InstallModules();
64-
CoreSettingsHandler.CreateCoreSettings();
65-
AddScriptingDefineSymbolToAllBuildTargetGroups(READY_PLAYER_ME_SYMBOL);
66-
AddGltfastSymbol();
49+
EditorApplication.delayCall += DelayCreateCoreSettings;
6750
}
68-
ValidateModules();
69-
}
7051

71-
/// <summary>
72-
/// Called when a package is about to be added, removed or changed.
73-
/// </summary>
74-
/// <param name="args">Describes the <c>PackageInfo</c> entries of packages currently registering.</param>
75-
private static void OnRegisteringPackages(PackageRegistrationEventArgs args)
76-
{
77-
// Core module uninstalled
78-
if (args.removed != null && args.removed.Any(p => p.name == CORE_MODULE_NAME))
52+
#if !GLTFAST
53+
if (IsModuleInstalled(GLTFAST_NAME))
7954
{
80-
// Remove modules that depend on core here, or not?
55+
AddGltfastSymbol();
56+
AddScriptingDefineSymbolToAllBuildTargetGroups(READY_PLAYER_ME_SYMBOL);
8157
}
58+
#endif
8259

83-
Events.registeringPackages -= OnRegisteringPackages;
60+
}
61+
62+
private static void DelayCreateCoreSettings()
63+
{
64+
CoreSettingsHandler.CreateCoreSettings();
65+
EditorApplication.delayCall -= DelayCreateCoreSettings;
8466
}
8567

8668
/// <summary>
@@ -107,8 +89,8 @@ private static void InstallModules()
10789
EditorUtility.DisplayProgressBar(PROGRESS_BAR_TITLE, ALL_MODULES_ARE_INSTALLED, 1);
10890
Thread.Sleep(THREAD_SLEEP_TIME);
10991
}
110-
11192
EditorUtility.ClearProgressBar();
93+
modulesInstalled = true;
11294
}
11395

11496
/// <summary>

Editor/Utils/EditorUtilities.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public static bool IsUrlShortcodeValid(string urlString)
4040
return !string.IsNullOrEmpty(urlString) &&
4141
(Regex.Match(urlString, SHORT_CODE_REGEX).Length > 0 || Uri.IsWellFormedUriString(urlString, UriKind.Absolute) && urlString.EndsWith(".glb"));
4242
}
43-
44-
public static GameObject CreateAvatarPrefab(AvatarMetadata avatarMetadata, string path)
43+
44+
public static GameObject CreateAvatarPrefab(AvatarMetadata avatarMetadata, string path, string prefabPath = null)
4545
{
4646
var modelFilePath = $"{path}.glb";
4747
AssetDatabase.Refresh();
@@ -53,7 +53,7 @@ public static GameObject CreateAvatarPrefab(AvatarMetadata avatarMetadata, strin
5353
var avatarData = newAvatar.AddComponent<AvatarData>();
5454
avatarData.AvatarMetadata = avatarMetadata;
5555
avatarData.AvatarId = newAvatar.name;
56-
CreatePrefab(newAvatar, $"{path}.prefab");
56+
CreatePrefab(newAvatar, prefabPath ?? $"{path}.prefab");
5757
return newAvatar;
5858
}
5959
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Ready Player Me Unity SDK Core
22

3-
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/releases/latest) [![GitHub Discussions](https://img.shields.io/github/discussions/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/discussions)
3+
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/releases/latest) [![GitHub Discussions](https://img.shields.io/github/discussions/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/discussions) [![Run Integration Tests](https://github.com/readyplayerme/rpm-unity-sdk-core/actions/workflows/integration-test.yml/badge.svg)](https://github.com/readyplayerme/rpm-unity-sdk-core/actions/workflows/integration-test.yml)
44

5-
This is an open source Unity plugin that contains all the core functionality required for and manages all the plugin updates and dependencies including Ready Player Me Avatar Loader and glTFast.
5+
This is an open source Unity plugin that contains all the core functionality required for a Ready Player Me avatar integration, and manages all the plugin updates and dependencies including Ready Player Me Avatar Loader and glTFast.
66

77
Please visit the online documentation and join our public `discord` community.
88

@@ -20,7 +20,7 @@ Please visit the online documentation and join our public `discord` community.
2020

2121
**1.** To add the new Ready Player Me Unity SDK to your project you can use the Unity Package Manager to import the package directly from the Git URL.
2222

23-
**2.** With your Unity Project open open up the Package Manager window by going to `Window > Package Manager`.
23+
**2.** With your Unity Project open, open up the Package Manager window by going to `Window > Package Manager`.
2424

2525
![open-package-manager](https://user-images.githubusercontent.com/7085672/206432665-da233187-06ad-40b5-a25e-660c97d6726f.png)
2626

@@ -92,7 +92,7 @@ After the process is complete you project will have imported these packages:
9292
}
9393
],
9494
"dependencies": {
95-
"com.readyplayerme.core": "3.2.0"
95+
"com.readyplayerme.core": "3.2.2"
9696
}
9797
}
9898
```

Runtime/AvatarObjectLoader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void LoadAvatar(string url)
7373
avatarUrl = url;
7474
Load(url);
7575
}
76-
76+
7777
/// <summary>
7878
/// Load avatar asynchronously from a URL and return the result as eventArgs.
7979
/// </summary>
@@ -92,12 +92,12 @@ public async Task<EventArgs> LoadAvatarAsync(string url)
9292
eventArgs = args;
9393
isCompleted = true;
9494
};
95-
95+
9696
startTime = Time.timeSinceLevelLoad;
9797
SDKLogger.Log(TAG, $"Started loading avatar with config {(AvatarConfig ? AvatarConfig.name : "None")} from URL {url}");
9898
avatarUrl = url;
9999
Load(url);
100-
100+
101101
while (!isCompleted)
102102
{
103103
await Task.Yield();

Runtime/Data/ApplicationData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ReadyPlayerMe.Core
66
{
77
public static class ApplicationData
88
{
9-
private const string SDK_VERSION = "v3.2.0";
9+
private const string SDK_VERSION = "v3.2.2";
1010
private const string TAG = "ApplicationData";
1111
private const string DEFAULT_RENDER_PIPELINE = "Built-In Render Pipeline";
1212
private static readonly AppData Data;

0 commit comments

Comments
 (0)