Merge remote-tracking branch 'origin/master' into gi

This commit is contained in:
Wojciech Figat
2022-04-11 10:37:23 +02:00
59 changed files with 471 additions and 314 deletions

View File

@@ -1,6 +1,8 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
using Object = FlaxEngine.Object;
namespace FlaxEditor.Viewport.Previews
{
@@ -39,7 +41,7 @@ namespace FlaxEditor.Viewport.Previews
// Wait for base (don't want to async material parameters set due to async loading)
if (baseMaterial == null || baseMaterial.WaitForLoaded())
throw new FlaxException("Cannot load IES Profile preview material.");
throw new Exception("Cannot load IES Profile preview material.");
// Create preview material (virtual)
_previewMaterial = baseMaterial.CreateVirtualInstance();

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
using Object = FlaxEngine.Object;
@@ -54,7 +55,7 @@ namespace FlaxEditor.Viewport.Previews
if (instance == null)
{
_prefab = null;
throw new FlaxException("Failed to spawn a prefab for the preview.");
throw new Exception("Failed to spawn a prefab for the preview.");
}
// Set instance

View File

@@ -319,10 +319,10 @@ namespace FlaxEditor.Viewport.Previews
// Create preview material (virtual)
var baseMaterial = FlaxEngine.Content.LoadAsyncInternal<Material>("Editor/TexturePreviewMaterial");
if (baseMaterial == null)
throw new FlaxException("Cannot load texture preview material.");
throw new Exception("Cannot load texture preview material.");
_previewMaterial = baseMaterial.CreateVirtualInstance();
if (_previewMaterial == null)
throw new FlaxException("Failed to create virtual material instance for preview material.");
throw new Exception("Failed to create virtual material instance for preview material.");
// Add widgets
if (useWidgets)