Skip to content

Commit

Permalink
Add proper flow to take care on who are not using VCC...
Browse files Browse the repository at this point in the history
...but want to Update this thing inside Unity.
  • Loading branch information
JLChnToZ committed Jan 30, 2024
1 parent 0950f95 commit e1b8233
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Packages/idv.jlchntoz.vvmw/Editor/Common/PackageSelfUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ public void ResolveInstallation() {
#if VPM_RESOLVER_INCLUDED
if (!Repos.UserRepoExists(listingsID) && !Repos.AddRepo(new Uri(listingsURL)))
return;
ConfirmAndUpdate();
#endif
ConfirmAndUpdate();
}

public void ConfirmAndUpdate() {
#if VPM_RESOLVER_INCLUDED
if (string.IsNullOrEmpty(packageName)) {
Debug.LogError("Unable to find package name.");
return;
}
#if VPM_RESOLVER_INCLUDED
var version = availableVersion;
if (string.IsNullOrEmpty(version)) {
var allVersions = Resolver.GetAllVersionsOf(packageName);
Expand All @@ -108,6 +108,17 @@ public void ConfirmAndUpdate() {
sb.AppendLine($"- {dependency}");
if (EditorUtility.DisplayDialog("Update Package", sb.ToString(), "Update", "Cancel"))
UpdateUnchecked(vrcPackage).Forget();
#else
switch (EditorUtility.DisplayDialogComplex(
"Unable to Update Package",
"It seems your project is not managed by VRChat Creator Companion (VCC).\n" +
"You need to migrate your project to Creator Companion to get automatic updates.",
"Close", "What is Creator Companion?", "How to migrate?"
)) {
case 1: Application.OpenURL("https://vcc.docs.vrchat.com/"); break;
case 2: Application.OpenURL("https://vcc.docs.vrchat.com/vpm/migrating"); break;
}
Debug.LogError("Unable to update package. Please migrate your project to Creator Companion first.");
#endif
}

Expand Down

0 comments on commit e1b8233

Please sign in to comment.