Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity 2023 PackageStatus replaced by PackageSource #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions Editor/AutoLOD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,20 @@ static IEnumerator GetDefaultSimplifier()
while (!list.IsCompleted)
yield return null;

PackageStatus status = PackageStatus.Unknown;
PackageSource status = PackageSource.Unknown;
if (list.Status == StatusCode.Success)
{
foreach (var package in list.Result)
{
if (package.name == "com.whinarn.unitymeshsimplifier")
{
status = package.status;
status = package.source;
break;
}
}
}

if (status != PackageStatus.Available
if (status != PackageSource.Git
&& EditorUtility.DisplayDialog("Install Default Mesh Simplifier?",
"You are missing a default mesh simplifier. Would you like to install one?",
"Yes", "No"))
Expand All @@ -206,18 +206,18 @@ static IEnumerator GetDefaultSimplifier()
switch (request.Status)
{
case StatusCode.Success:
status = PackageStatus.Available;
status = PackageSource.Git;
break;
case StatusCode.InProgress:
status = PackageStatus.InProgress;
status = PackageSource.Unknown;
break;
case StatusCode.Failure:
Debug.LogError($"AutoLOD: {request.Error.message}");
break;
}
}

if (status == PackageStatus.Available)
if (status == PackageSource.Git)
{
// Cribbed from ConditionalCompilationUtility
// TODO: Remove when minimum version is 2019 LTS and use define constraints instead
Expand Down Expand Up @@ -246,7 +246,7 @@ static IEnumerator GetDefaultSimplifier()
EditorApplication.UnlockReloadAssemblies();
}
}
else if (status != PackageStatus.InProgress)
else if (status != PackageSource.Unknown)
{
Debug.LogError("AutoLOD: You must set a valid Default Mesh Simplifier under Edit -> Preferences");
}
Expand Down