Skip to content

Commit

Permalink
chore: update version and fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jan 10, 2024
1 parent 6a6d38c commit ce23934
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class IntegrationGuide : EditorWindow
private const string OPTIMIZE_THE_PERFORMANCE = "OptimizeThePerformance";
private const string CORE_PACKAGE = "com.readyplayerme.core";
private const string QUICKSTART_SAMPLE_NAME = "QuickStart";
private const string AVATAR_CREATOR_SAMPLE_NAME = "LegacyAvatarCreator";
private const string AVATAR_CREATOR_SAMPLE_SCENE_NAME = "Scenes/LegacyAvatarCreator";

private const string AVATAR_CREATOR_SAMPLE_NAME = "AvatarCreatorSamples";
private const string AVATAR_CREATOR_SAMPLE_SCENE_PATH = "LegacyAvatarCreator/Scenes/LegacyAvatarCreator";
private const string SAMPLES_FOLDER_PATH = "Assets/Ready Player Me/Core/Samples";
[SerializeField] private VisualTreeAsset visualTreeAsset;

[MenuItem("Tools/Ready Player Me/Integration Guide", priority = 12)]
Expand Down Expand Up @@ -75,7 +75,7 @@ private void RegisterButtons()
rootVisualElement.Q<VisualElement>(INTEGRATE_AVATAR_CREATOR).Q<Button>("LoadSampleSceneButton").clicked += () =>
{
AnalyticsEditorLogger.EventLogger.LogAvatarCreatorSampleImported();
LoadAndOpenSample(AVATAR_CREATOR_SAMPLE_NAME, AVATAR_CREATOR_SAMPLE_SCENE_NAME);
LoadAndOpenSample(AVATAR_CREATOR_SAMPLE_NAME, AVATAR_CREATOR_SAMPLE_SCENE_PATH);
};

rootVisualElement.Q<VisualElement>(OPTIMIZE_THE_PERFORMANCE).Q<Button>().clicked += () =>
Expand Down Expand Up @@ -105,8 +105,13 @@ private void LoadAndOpenSample(string sampleName, string scenePath)

private bool LoadFromAssetsFolder(string sampleName, string scenePath)
{
var folderPath = $"Assets/Ready Player Me/Core/Samples/{sampleName}";
var version = ApplicationData.GetData().UnityVersion;

var folderPath = $"{SAMPLES_FOLDER_PATH}/{sampleName}";
if (!Directory.Exists(folderPath))
{
folderPath = $"{SAMPLES_FOLDER_PATH}/{version}/{sampleName}";
}
if (!Directory.Exists(folderPath)) return false;
var fullScenePath = $"{folderPath}/{scenePath}.unity";
if (!File.Exists(fullScenePath)) return false;
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Scripts/Data/ApplicationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ReadyPlayerMe.Core
{
public static class ApplicationData
{
private const string SDK_VERSION = "v5.0.0";
private const string SDK_VERSION = "5.0.0";
private const string TAG = "ApplicationData";
private const string DEFAULT_RENDER_PIPELINE = "Built-In Render Pipeline";
private static readonly AppData Data;
Expand Down

0 comments on commit ce23934

Please sign in to comment.