Skip to content

Commit

Permalink
feat: handle loading sample if installed in assets folder
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jan 3, 2024
1 parent e2afffb commit d3d64be
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.IO;
using ReadyPlayerMe.Core.Analytics;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.UIElements;

Expand Down Expand Up @@ -85,6 +87,21 @@ private void RegisterButtons()

private void LoadAndOpenSample(string sampleName, string scenePath)
{

var folderPath = $"Assets/Ready Player Me/Samples/{sampleName}";

if (Directory.Exists(folderPath))
{
var fullScenePath = $"{folderPath}/{scenePath}.unity";
if (File.Exists(scenePath))
{
// Load the scene
EditorSceneManager.OpenScene(fullScenePath);
Debug.Log("Scene 'QuickStart' opened.");
return;
}
}

var sampleLoader = new SampleLoader();

if (sampleLoader.Load(CORE_PACKAGE, sampleName))
Expand Down

0 comments on commit d3d64be

Please sign in to comment.