Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Dev/platform config profile install (#76)
Browse files Browse the repository at this point in the history
* updated installation path

* Added manual asset install menu item

* added profiles suffix to editor pref key

* updated method name
  • Loading branch information
StephenHodgson authored May 4, 2020
1 parent 65bd591 commit f57e28e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Editor/WindowsMixedRealityPackageInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,27 @@ internal static class WindowsMixedRealityPackageInstaller

static WindowsMixedRealityPackageInstaller()
{
if (!EditorPreferences.Get($"{nameof(WindowsMixedRealityPackageInstaller)}", false))
EditorApplication.delayCall += CheckPackage;
}

[MenuItem("Mixed Reality Toolkit/Packages/Install Windows Mixed Realty Package Assets...", true)]
private static bool ImportPackageAssetsValidation()
{
return !Directory.Exists($"{DefaultPath}\\Profiles");
}

[MenuItem("Mixed Reality Toolkit/Packages/Install Windows Mixed Realty Package Assets...")]
private static void ImportPackageAssets()
{
EditorPreferences.Set($"{nameof(WindowsMixedRealityPackageInstaller)}.Profiles", false);
EditorApplication.delayCall += CheckPackage;
}

private static void CheckPackage()
{
if (!EditorPreferences.Get($"{nameof(WindowsMixedRealityPackageInstaller)}.Profiles", false))
{
EditorPreferences.Set($"{nameof(WindowsMixedRealityPackageInstaller)}", PackageInstaller.TryInstallProfiles(HiddenPath, DefaultPath));
EditorPreferences.Set($"{nameof(WindowsMixedRealityPackageInstaller)}.Profiles", PackageInstaller.TryInstallAssets(HiddenPath, $"{DefaultPath}\\Profiles"));
}
}
}
Expand Down

0 comments on commit f57e28e

Please sign in to comment.