Remove FlaxException
This commit is contained in:
@@ -891,10 +891,10 @@ namespace FlaxEditor
|
|||||||
if (asset == null)
|
if (asset == null)
|
||||||
throw new ArgumentNullException(nameof(asset));
|
throw new ArgumentNullException(nameof(asset));
|
||||||
if (asset.WaitForLoaded())
|
if (asset.WaitForLoaded())
|
||||||
throw new FlaxException("Failed to load asset.");
|
throw new Exception("Failed to load asset.");
|
||||||
var source = Internal_GetShaderAssetSourceCode(FlaxEngine.Object.GetUnmanagedPtr(asset));
|
var source = Internal_GetShaderAssetSourceCode(FlaxEngine.Object.GetUnmanagedPtr(asset));
|
||||||
if (source == null)
|
if (source == null)
|
||||||
throw new FlaxException("Failed to get source code.");
|
throw new Exception("Failed to get source code.");
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (spriteIndex == -1)
|
if (spriteIndex == -1)
|
||||||
throw new FlaxException();
|
throw new Exception();
|
||||||
atlas.Count++;
|
atlas.Count++;
|
||||||
_atlases[atlasIndex] = atlas;
|
_atlases[atlasIndex] = atlas;
|
||||||
var sprite = new SpriteHandle(atlas.Texture, spriteIndex);
|
var sprite = new SpriteHandle(atlas.Texture, spriteIndex);
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ namespace FlaxEditor.Modules
|
|||||||
|
|
||||||
// Call backend
|
// Call backend
|
||||||
if (PrefabManager.Internal_ApplyAll(FlaxEngine.Object.GetUnmanagedPtr(instance)))
|
if (PrefabManager.Internal_ApplyAll(FlaxEngine.Object.GetUnmanagedPtr(instance)))
|
||||||
throw new FlaxException("Failed to apply the prefab. See log to learn more.");
|
throw new Exception("Failed to apply the prefab. See log to learn more.");
|
||||||
|
|
||||||
PrefabApplied?.Invoke(prefab, instance);
|
PrefabApplied?.Invoke(prefab, instance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using FlaxEditor.Tools.Terrain.Brushes;
|
using FlaxEditor.Tools.Terrain.Brushes;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
|
|
||||||
@@ -129,9 +130,7 @@ namespace FlaxEditor.Tools.Terrain.Paint
|
|||||||
// Get the patch data (cached internally by the c++ core in editor)
|
// Get the patch data (cached internally by the c++ core in editor)
|
||||||
var sourceData = TerrainTools.GetSplatMapData(terrain, ref patch.PatchCoord, splatmapIndex);
|
var sourceData = TerrainTools.GetSplatMapData(terrain, ref patch.PatchCoord, splatmapIndex);
|
||||||
if (sourceData == null)
|
if (sourceData == null)
|
||||||
{
|
throw new Exception("Cannot modify terrain. Loading splatmap failed. See log for more info.");
|
||||||
throw new FlaxException("Cannot modify terrain. Loading splatmap failed. See log for more info.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Record patch data before editing it
|
// Record patch data before editing it
|
||||||
if (!gizmo.CurrentEditUndoAction.HashPatch(ref patch.PatchCoord))
|
if (!gizmo.CurrentEditUndoAction.HashPatch(ref patch.PatchCoord))
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using FlaxEditor.Tools.Terrain.Brushes;
|
using FlaxEditor.Tools.Terrain.Brushes;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
|
|
||||||
@@ -128,9 +129,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt
|
|||||||
float* sourceHeights = EditHoles ? null : TerrainTools.GetHeightmapData(terrain, ref patch.PatchCoord);
|
float* sourceHeights = EditHoles ? null : TerrainTools.GetHeightmapData(terrain, ref patch.PatchCoord);
|
||||||
byte* sourceHoles = EditHoles ? TerrainTools.GetHolesMaskData(terrain, ref patch.PatchCoord) : null;
|
byte* sourceHoles = EditHoles ? TerrainTools.GetHolesMaskData(terrain, ref patch.PatchCoord) : null;
|
||||||
if (sourceHeights == null && sourceHoles == null)
|
if (sourceHeights == null && sourceHoles == null)
|
||||||
{
|
throw new Exception("Cannot modify terrain. Loading heightmap failed. See log for more info.");
|
||||||
throw new FlaxException("Cannot modify terrain. Loading heightmap failed. See log for more info.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Record patch data before editing it
|
// Record patch data before editing it
|
||||||
if (!gizmo.CurrentEditUndoAction.HashPatch(ref patch.PatchCoord))
|
if (!gizmo.CurrentEditUndoAction.HashPatch(ref patch.PatchCoord))
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace FlaxEditor.Tools.Terrain.Undo
|
|||||||
var offset = Int2.Zero;
|
var offset = Int2.Zero;
|
||||||
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
|
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
|
||||||
if (TerrainTools.ModifyHeightMap(Terrain, ref patchCoord, (float*)data, ref offset, ref size))
|
if (TerrainTools.ModifyHeightMap(Terrain, ref patchCoord, (float*)data, ref offset, ref size))
|
||||||
throw new FlaxException("Failed to modify the heightmap.");
|
throw new Exception("Failed to modify the heightmap.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace FlaxEditor.Tools.Terrain.Undo
|
|||||||
var offset = Int2.Zero;
|
var offset = Int2.Zero;
|
||||||
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
|
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
|
||||||
if (TerrainTools.ModifyHolesMask(Terrain, ref patchCoord, (byte*)data, ref offset, ref size))
|
if (TerrainTools.ModifyHolesMask(Terrain, ref patchCoord, (byte*)data, ref offset, ref size))
|
||||||
throw new FlaxException("Failed to modify the terrain holes.");
|
throw new Exception("Failed to modify the terrain holes.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace FlaxEditor.Tools.Terrain.Undo
|
|||||||
var offset = Int2.Zero;
|
var offset = Int2.Zero;
|
||||||
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
|
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
|
||||||
if (TerrainTools.ModifySplatMap(Terrain, ref patchCoord, (int)tag, (Color32*)data, ref offset, ref size))
|
if (TerrainTools.ModifySplatMap(Terrain, ref patchCoord, (int)tag, (Color32*)data, ref offset, ref size))
|
||||||
throw new FlaxException("Failed to modify the splatmap.");
|
throw new Exception("Failed to modify the splatmap.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace FlaxEditor.Actions
|
|||||||
if (actor == null)
|
if (actor == null)
|
||||||
throw new ArgumentNullException(nameof(actor));
|
throw new ArgumentNullException(nameof(actor));
|
||||||
if (!actor.HasPrefabLink)
|
if (!actor.HasPrefabLink)
|
||||||
throw new FlaxException("Cannot register missing prefab link.");
|
throw new Exception("Cannot register missing prefab link.");
|
||||||
return new BreakPrefabLinkAction(false, actor);
|
return new BreakPrefabLinkAction(false, actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,11 +102,11 @@ namespace FlaxEditor.Actions
|
|||||||
private void DoLink()
|
private void DoLink()
|
||||||
{
|
{
|
||||||
if (_prefabObjectIds == null)
|
if (_prefabObjectIds == null)
|
||||||
throw new FlaxException("Cannot link prefab. Missing objects Ids mapping.");
|
throw new Exception("Cannot link prefab. Missing objects Ids mapping.");
|
||||||
|
|
||||||
var actor = Object.Find<Actor>(ref _actorId);
|
var actor = Object.Find<Actor>(ref _actorId);
|
||||||
if (actor == null)
|
if (actor == null)
|
||||||
throw new FlaxException("Cannot link prefab. Missing actor.");
|
throw new Exception("Cannot link prefab. Missing actor.");
|
||||||
|
|
||||||
// Restore cached links
|
// Restore cached links
|
||||||
foreach (var e in _prefabObjectIds)
|
foreach (var e in _prefabObjectIds)
|
||||||
@@ -149,9 +149,9 @@ namespace FlaxEditor.Actions
|
|||||||
{
|
{
|
||||||
var actor = Object.Find<Actor>(ref _actorId);
|
var actor = Object.Find<Actor>(ref _actorId);
|
||||||
if (actor == null)
|
if (actor == null)
|
||||||
throw new FlaxException("Cannot break prefab link. Missing actor.");
|
throw new Exception("Cannot break prefab link. Missing actor.");
|
||||||
if (!actor.HasPrefabLink)
|
if (!actor.HasPrefabLink)
|
||||||
throw new FlaxException("Cannot break missing prefab link.");
|
throw new Exception("Cannot break missing prefab link.");
|
||||||
|
|
||||||
if (_prefabObjectIds == null)
|
if (_prefabObjectIds == null)
|
||||||
_prefabObjectIds = new Dictionary<Guid, Guid>(1024);
|
_prefabObjectIds = new Dictionary<Guid, Guid>(1024);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace FlaxEditor.Utilities
|
|||||||
if (Level.UnloadAllScenes())
|
if (Level.UnloadAllScenes())
|
||||||
{
|
{
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
throw new FlaxException("Failed to unload scenes.");
|
throw new Exception("Failed to unload scenes.");
|
||||||
}
|
}
|
||||||
FlaxEngine.Scripting.FlushRemovedObjects();
|
FlaxEngine.Scripting.FlushRemovedObjects();
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ namespace FlaxEditor.Utilities
|
|||||||
if (noScenes != null && noScenes.Length != 0)
|
if (noScenes != null && noScenes.Length != 0)
|
||||||
{
|
{
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
throw new FlaxException("Failed to unload scenes.");
|
throw new Exception("Failed to unload scenes.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ namespace FlaxEditor.Utilities
|
|||||||
if (scene == null)
|
if (scene == null)
|
||||||
{
|
{
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
throw new FlaxException("Failed to deserialize scene");
|
throw new Exception("Failed to deserialize scene");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ namespace FlaxEditor.Utilities
|
|||||||
if (Level.UnloadAllScenes())
|
if (Level.UnloadAllScenes())
|
||||||
{
|
{
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
throw new FlaxException("Failed to unload scenes.");
|
throw new Exception("Failed to unload scenes.");
|
||||||
}
|
}
|
||||||
FlaxEngine.Scripting.FlushRemovedObjects();
|
FlaxEngine.Scripting.FlushRemovedObjects();
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
@@ -154,7 +154,7 @@ namespace FlaxEditor.Utilities
|
|||||||
if (scene == null)
|
if (scene == null)
|
||||||
{
|
{
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
throw new FlaxException("Failed to deserialize scene");
|
throw new Exception("Failed to deserialize scene");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore `dirty` state
|
// Restore `dirty` state
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
|
using Object = FlaxEngine.Object;
|
||||||
|
|
||||||
namespace FlaxEditor.Viewport.Previews
|
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)
|
// Wait for base (don't want to async material parameters set due to async loading)
|
||||||
if (baseMaterial == null || baseMaterial.WaitForLoaded())
|
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)
|
// Create preview material (virtual)
|
||||||
_previewMaterial = baseMaterial.CreateVirtualInstance();
|
_previewMaterial = baseMaterial.CreateVirtualInstance();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
using Object = FlaxEngine.Object;
|
using Object = FlaxEngine.Object;
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ namespace FlaxEditor.Viewport.Previews
|
|||||||
if (instance == null)
|
if (instance == null)
|
||||||
{
|
{
|
||||||
_prefab = 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
|
// Set instance
|
||||||
|
|||||||
@@ -319,10 +319,10 @@ namespace FlaxEditor.Viewport.Previews
|
|||||||
// Create preview material (virtual)
|
// Create preview material (virtual)
|
||||||
var baseMaterial = FlaxEngine.Content.LoadAsyncInternal<Material>("Editor/TexturePreviewMaterial");
|
var baseMaterial = FlaxEngine.Content.LoadAsyncInternal<Material>("Editor/TexturePreviewMaterial");
|
||||||
if (baseMaterial == null)
|
if (baseMaterial == null)
|
||||||
throw new FlaxException("Cannot load texture preview material.");
|
throw new Exception("Cannot load texture preview material.");
|
||||||
_previewMaterial = baseMaterial.CreateVirtualInstance();
|
_previewMaterial = baseMaterial.CreateVirtualInstance();
|
||||||
if (_previewMaterial == null)
|
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
|
// Add widgets
|
||||||
if (useWidgets)
|
if (useWidgets)
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace FlaxEngine
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Flax exception object.
|
|
||||||
/// </summary>
|
|
||||||
/// <seealso cref="System.SystemException" />
|
|
||||||
[Serializable]
|
|
||||||
public class FlaxException : SystemException
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="FlaxException"/> class.
|
|
||||||
/// </summary>
|
|
||||||
public FlaxException()
|
|
||||||
: base("A Flax runtime error occurred!")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="FlaxException"/> class.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="message">The message that describes the error.</param>
|
|
||||||
public FlaxException(string message)
|
|
||||||
: base(message)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="FlaxException"/> class.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="message">The error message that explains the reason for the exception.</param>
|
|
||||||
/// <param name="innerException">The exception that is the cause of the current exception. If the <paramref name="innerException" /> parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.</param>
|
|
||||||
public FlaxException(string message, Exception innerException)
|
|
||||||
: base(message, innerException)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -154,7 +154,7 @@ namespace FlaxEngine
|
|||||||
uv,
|
uv,
|
||||||
colors
|
colors
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -201,7 +201,7 @@ namespace FlaxEngine
|
|||||||
Utils.ExtractArrayFromList(uv),
|
Utils.ExtractArrayFromList(uv),
|
||||||
Utils.ExtractArrayFromList(colors)
|
Utils.ExtractArrayFromList(colors)
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -247,7 +247,7 @@ namespace FlaxEngine
|
|||||||
uv,
|
uv,
|
||||||
colors
|
colors
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -294,7 +294,7 @@ namespace FlaxEngine
|
|||||||
Utils.ExtractArrayFromList(uv),
|
Utils.ExtractArrayFromList(uv),
|
||||||
Utils.ExtractArrayFromList(colors)
|
Utils.ExtractArrayFromList(colors)
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -341,7 +341,7 @@ namespace FlaxEngine
|
|||||||
uv,
|
uv,
|
||||||
colors
|
colors
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -388,7 +388,7 @@ namespace FlaxEngine
|
|||||||
Utils.ExtractArrayFromList(uv),
|
Utils.ExtractArrayFromList(uv),
|
||||||
Utils.ExtractArrayFromList(colors)
|
Utils.ExtractArrayFromList(colors)
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -412,7 +412,7 @@ namespace FlaxEngine
|
|||||||
triangles.Length / 3,
|
triangles.Length / 3,
|
||||||
triangles
|
triangles
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -436,7 +436,7 @@ namespace FlaxEngine
|
|||||||
triangles.Count / 3,
|
triangles.Count / 3,
|
||||||
Utils.ExtractArrayFromList(triangles)
|
Utils.ExtractArrayFromList(triangles)
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -460,7 +460,7 @@ namespace FlaxEngine
|
|||||||
triangles.Length / 3,
|
triangles.Length / 3,
|
||||||
triangles
|
triangles
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -484,7 +484,7 @@ namespace FlaxEngine
|
|||||||
triangles.Count / 3,
|
triangles.Count / 3,
|
||||||
Utils.ExtractArrayFromList(triangles)
|
Utils.ExtractArrayFromList(triangles)
|
||||||
))
|
))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
internal enum InternalBufferType
|
internal enum InternalBufferType
|
||||||
@@ -506,7 +506,7 @@ namespace FlaxEngine
|
|||||||
var vertices = VertexCount;
|
var vertices = VertexCount;
|
||||||
var result = new Vertex0[vertices];
|
var result = new Vertex0[vertices];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB0))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB0))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,7 +520,7 @@ namespace FlaxEngine
|
|||||||
var vertices = VertexCount;
|
var vertices = VertexCount;
|
||||||
var result = new Vertex1[vertices];
|
var result = new Vertex1[vertices];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB1))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB1))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ namespace FlaxEngine
|
|||||||
var vertices = VertexCount;
|
var vertices = VertexCount;
|
||||||
var result = new Vertex2[vertices];
|
var result = new Vertex2[vertices];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB2))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB2))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,7 +597,7 @@ namespace FlaxEngine
|
|||||||
var triangles = TriangleCount;
|
var triangles = TriangleCount;
|
||||||
var result = new uint[triangles * 3];
|
var result = new uint[triangles * 3];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB32))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB32))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -612,7 +612,7 @@ namespace FlaxEngine
|
|||||||
var triangles = TriangleCount;
|
var triangles = TriangleCount;
|
||||||
var result = new ushort[triangles * 3];
|
var result = new ushort[triangles * 3];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB16))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB16))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ namespace FlaxEngine
|
|||||||
throw new ArgumentOutOfRangeException(nameof(uv));
|
throw new ArgumentOutOfRangeException(nameof(uv));
|
||||||
|
|
||||||
if (Internal_UpdateMeshUInt(__unmanagedPtr, vertices, triangles, blendIndices, blendWeights, normals, tangents, uv))
|
if (Internal_UpdateMeshUInt(__unmanagedPtr, vertices, triangles, blendIndices, blendWeights, normals, tangents, uv))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -167,7 +167,7 @@ namespace FlaxEngine
|
|||||||
throw new ArgumentOutOfRangeException(nameof(uv));
|
throw new ArgumentOutOfRangeException(nameof(uv));
|
||||||
|
|
||||||
if (Internal_UpdateMeshUInt(__unmanagedPtr, vertices, triangles, blendIndices, blendWeights, normals, tangents, uv))
|
if (Internal_UpdateMeshUInt(__unmanagedPtr, vertices, triangles, blendIndices, blendWeights, normals, tangents, uv))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -203,7 +203,7 @@ namespace FlaxEngine
|
|||||||
throw new ArgumentOutOfRangeException(nameof(uv));
|
throw new ArgumentOutOfRangeException(nameof(uv));
|
||||||
|
|
||||||
if (Internal_UpdateMeshUShort(__unmanagedPtr, vertices, triangles, blendIndices, blendWeights, normals, tangents, uv))
|
if (Internal_UpdateMeshUShort(__unmanagedPtr, vertices, triangles, blendIndices, blendWeights, normals, tangents, uv))
|
||||||
throw new FlaxException("Failed to update mesh data.");
|
throw new Exception("Failed to update mesh data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
internal enum InternalBufferType
|
internal enum InternalBufferType
|
||||||
@@ -223,7 +223,7 @@ namespace FlaxEngine
|
|||||||
var vertices = VertexCount;
|
var vertices = VertexCount;
|
||||||
var result = new Vertex0[vertices];
|
var result = new Vertex0[vertices];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB0))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.VB0))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ namespace FlaxEngine
|
|||||||
var triangles = TriangleCount;
|
var triangles = TriangleCount;
|
||||||
var result = new uint[triangles * 3];
|
var result = new uint[triangles * 3];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB32))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB32))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ namespace FlaxEngine
|
|||||||
var triangles = TriangleCount;
|
var triangles = TriangleCount;
|
||||||
var result = new ushort[triangles * 3];
|
var result = new ushort[triangles * 3];
|
||||||
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB16))
|
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB16))
|
||||||
throw new FlaxException("Failed to download mesh data.");
|
throw new Exception("Failed to download mesh data.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ namespace FlaxEngine
|
|||||||
|
|
||||||
// Call backend
|
// Call backend
|
||||||
if (Internal_Init(__unmanagedPtr, new IntPtr(&t)))
|
if (Internal_Init(__unmanagedPtr, new IntPtr(&t)))
|
||||||
throw new FlaxException("Failed to init texture data.");
|
throw new Exception("Failed to init texture data.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace FlaxEngine
|
|||||||
{
|
{
|
||||||
Internal_ManagedInstanceCreated(this);
|
Internal_ManagedInstanceCreated(this);
|
||||||
if (__unmanagedPtr == IntPtr.Zero)
|
if (__unmanagedPtr == IntPtr.Zero)
|
||||||
throw new FlaxException($"Failed to create native instance for object of type {GetType().FullName} (assembly: {GetType().Assembly.FullName}).");
|
throw new Exception($"Failed to create native instance for object of type {GetType().FullName} (assembly: {GetType().Assembly.FullName}).");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ namespace FlaxEngine.Json
|
|||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
if (reader.TokenType != JsonToken.Comment)
|
if (reader.TokenType != JsonToken.Comment)
|
||||||
throw new FlaxException("Additional text found in JSON string after finishing deserializing object.");
|
throw new Exception("Additional text found in JSON string after finishing deserializing object.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,7 +226,7 @@ namespace FlaxEngine.Json
|
|||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
if (reader.TokenType != JsonToken.Comment)
|
if (reader.TokenType != JsonToken.Comment)
|
||||||
throw new FlaxException("Additional text found in JSON string after finishing deserializing object.");
|
throw new Exception("Additional text found in JSON string after finishing deserializing object.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ namespace FlaxEngine.Json
|
|||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
if (reader.TokenType != JsonToken.Comment)
|
if (reader.TokenType != JsonToken.Comment)
|
||||||
throw new FlaxException("Additional text found in JSON string after finishing deserializing object.");
|
throw new Exception("Additional text found in JSON string after finishing deserializing object.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ namespace FlaxEngine.Json
|
|||||||
while (jsonReader.Read())
|
while (jsonReader.Read())
|
||||||
{
|
{
|
||||||
if (jsonReader.TokenType != JsonToken.Comment)
|
if (jsonReader.TokenType != JsonToken.Comment)
|
||||||
throw new FlaxException("Additional text found in JSON string after finishing deserializing object.");
|
throw new Exception("Additional text found in JSON string after finishing deserializing object.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user