Skip to content

Added the possibility to replace or overwrite already existing local package when installing a new one. #1921

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

Merged
merged 3 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Skip biquadratic resampling of vbuffer when volumetric fog filtering is enabled.
- Optimized Grain and sRGB Dithering.
- On platforms that allow it skip the first mip of the depth pyramid and compute it alongside the depth buffer used for low res transparents.
- When trying to install the local configuration package, if another one is already present the user is now asked whether they want to keep it or not.

## [10.0.0] - 2019-06-10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Entry[] entries
new Entry(InclusiveScope.DXR, Style.dxrActivated, IsDXRActivationCorrect, FixDXRActivation),
new Entry(InclusiveScope.DXR, Style.dxr64bits, IsArchitecture64Bits, FixArchitecture64Bits),
new Entry(InclusiveScope.DXR, Style.dxrResources, IsDXRAssetCorrect, FixDXRAsset),

// Optional checks
new Entry(InclusiveScope.DXROptional, Style.dxrScreenSpaceShadow, IsDXRScreenSpaceShadowCorrect, null, forceDisplayCheck: true, skipErrorIcon: true),
new Entry(InclusiveScope.DXROptional, Style.dxrReflections, IsDXRReflectionsCorrect, null, forceDisplayCheck: true, skipErrorIcon: true),
Expand Down Expand Up @@ -219,7 +219,7 @@ void FixAllEntryInScope(InclusiveScope scope)
});
}

#endregion
#endregion

#region Queue

Expand All @@ -233,7 +233,7 @@ class QueuedLauncher
public void Stop() => m_StopRequested = true;

// Function to pause/unpause the action execution
public void Pause() => m_OnPause = true;
public void Pause() => m_OnPause = true;
public void Unpause() => m_OnPause = false;

public int remainingFixes => m_Queue.Count;
Expand Down Expand Up @@ -569,7 +569,7 @@ bool IsDXRAutoGraphicsAPICorrect()
=> !PlayerSettings.GetUseDefaultGraphicsAPIs(CalculateSelectedBuildTarget());
void FixDXRAutoGraphicsAPI(bool fromAsyncUnused)
=> PlayerSettings.SetUseDefaultGraphicsAPIs(CalculateSelectedBuildTarget(), false);

bool IsDXRDirect3D12Correct()
=> PlayerSettings.GetGraphicsAPIs(CalculateSelectedBuildTarget()).FirstOrDefault() == GraphicsDeviceType.Direct3D12 && !HDProjectSettings.wizardNeedRestartAfterChangingToDX12;
void FixDXRDirect3D12(bool fromAsyncUnused)
Expand Down Expand Up @@ -624,7 +624,7 @@ void ChangedFirstGraphicAPI(BuildTarget target)
EditorApplication.quitting += () => HDProjectSettings.wizardNeedRestartAfterChangingToDX12 = false;
}
}

void CheckPersistantNeedReboot()
{
if (HDProjectSettings.wizardNeedRestartAfterChangingToDX12)
Expand Down Expand Up @@ -658,7 +658,7 @@ bool IsDXRTransparentReflectionsCorrect()
bool IsDXRGICorrect()
=> HDRenderPipeline.currentAsset != null
&& HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportSSGI;

bool IsArchitecture64Bits()
=> EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64;
void FixArchitecture64Bits(bool fromAsyncUnused)
Expand Down Expand Up @@ -705,7 +705,7 @@ void IsLocalConfigurationPackageInstalledAsync(Action<bool> callback)
callback?.Invoke(lastPackageConfigInstalledCheck = false);
return;
}

m_UsedPackageRetriever.ProcessAsync(
k_HdrpConfigPackageName,
(installed, info) =>
Expand All @@ -728,7 +728,23 @@ void InstallLocalConfigurationPackage(Action onCompletion)
{
// installed is not used because this one will be always installed

bool copyFolder = false;
if (!Directory.Exists(k_LocalHdrpConfigPackagePath))
{
copyFolder = true;
}
else
{
if (EditorUtility.DisplayDialog("Installing local configuration package",
"A local configuration package already exists. Do you want to replace it or keep it? Replacing it may overwrite local changes you made and keeping it may make it desynchronized with the main HDRP packages version.",
"Replace", "Keep"))
{
Directory.Delete(k_LocalHdrpConfigPackagePath, true);
copyFolder = true;
}
}

if (copyFolder)
{
CopyFolder(info.resolvedPath, k_LocalHdrpConfigPackagePath);
}
Expand All @@ -739,7 +755,7 @@ void InstallLocalConfigurationPackage(Action onCompletion)
onCompletion?.Invoke();
});
});

void RefreshDisplayOfConfigPackageArea()
{
if (!m_UsedPackageRetriever.isRunning)
Expand Down Expand Up @@ -773,7 +789,7 @@ class UsedPackageRetriever
string m_CurrentPackageName;

Queue<(string packageName, Action<bool, PackageManager.PackageInfo> action)> m_Queue = new Queue<(string packageName, Action<bool, PackageManager.PackageInfo> action)>();

bool isCurrentInProgress => m_CurrentRequest != null && !m_CurrentRequest.Equals(null) && !m_CurrentRequest.IsCompleted;

public bool isRunning => isCurrentInProgress || m_Queue.Count() > 0;
Expand Down Expand Up @@ -836,7 +852,7 @@ void Finished()
}
}
UsedPackageRetriever m_UsedPackageRetriever = new UsedPackageRetriever();

class LastAvailablePackageVersionRetriever
{
PackageManager.Requests.SearchRequest m_CurrentRequest;
Expand Down Expand Up @@ -901,7 +917,7 @@ void Finished()
}
}
LastAvailablePackageVersionRetriever m_LastAvailablePackageRetriever = new LastAvailablePackageVersionRetriever();

class PackageInstaller
{
PackageManager.Requests.AddRequest m_CurrentRequest;
Expand Down