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

Dev/platform config profile install #76

Merged
merged 4 commits into from
May 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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