diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.cs index 7d08213fa..30b4c147f 100644 --- a/Source/Editor/Viewport/MainEditorGizmoViewport.cs +++ b/Source/Editor/Viewport/MainEditorGizmoViewport.cs @@ -351,6 +351,8 @@ namespace FlaxEditor.Viewport private void OnCollectDrawCalls(ref RenderContext renderContext) { + if (renderContext.View.Pass == DrawPass.Depth) + return; DragHandlers.CollectDrawCalls(_debugDrawData, ref renderContext); if (ShowNavigation) Editor.Internal_DrawNavMesh(); diff --git a/Source/Editor/Viewport/PrefabWindowViewport.cs b/Source/Editor/Viewport/PrefabWindowViewport.cs index d7624892d..588a9bc85 100644 --- a/Source/Editor/Viewport/PrefabWindowViewport.cs +++ b/Source/Editor/Viewport/PrefabWindowViewport.cs @@ -98,7 +98,6 @@ namespace FlaxEditor.Viewport ShowDebugDraw = true; ShowEditorPrimitives = true; Gizmos = new GizmosCollection(this); - var inputOptions = window.Editor.Options.Options.Input; // Prepare rendering task Task.ActorsSource = ActorsSources.CustomActors; @@ -219,6 +218,8 @@ namespace FlaxEditor.Viewport private void OnCollectDrawCalls(ref RenderContext renderContext) { + if (renderContext.View.Pass == DrawPass.Depth) + return; DragHandlers.CollectDrawCalls(_debugDrawData, ref renderContext); _debugDrawData.OnDraw(ref renderContext); } diff --git a/Source/Engine/Scripting/ScriptingObject.h b/Source/Engine/Scripting/ScriptingObject.h index 9de79109f..2bbe09a96 100644 --- a/Source/Engine/Scripting/ScriptingObject.h +++ b/Source/Engine/Scripting/ScriptingObject.h @@ -132,7 +132,7 @@ public: static ScriptingObject* ToNative(MObject* obj); - static MObject* ToManaged(ScriptingObject* obj) + FORCE_INLINE static MObject* ToManaged(const ScriptingObject* obj) { return obj ? obj->GetOrCreateManagedInstance() : nullptr; } diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 3bf3a2a2a..138291177 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -1991,13 +1991,8 @@ namespace Flax.Build.Bindings } contents.Append(')').AppendLine(); contents.Append(" {").AppendLine(); - if (buildData.Target.IsEditor && false) - contents.Append(" MMethod* method = nullptr;").AppendLine(); // TODO: find a better way to cache event method in editor and handle C# hot-reload - else - contents.Append(" static MMethod* method = nullptr;").AppendLine(); - contents.Append(" if (!method)").AppendLine(); - contents.AppendFormat(" method = {1}::TypeInitializer.GetClass()->GetMethod(\"Internal_{0}_Invoke\", {2});", eventInfo.Name, classTypeNameNative, paramsCount).AppendLine(); - contents.Append(" CHECK(method);").AppendLine(); + contents.Append(" static MMethod* method = nullptr;").AppendLine(); + contents.AppendFormat(" if (!method) {{ method = {1}::TypeInitializer.GetClass()->GetMethod(\"Internal_{0}_Invoke\", {2}); CHECK(method); }}", eventInfo.Name, classTypeNameNative, paramsCount).AppendLine(); contents.Append(" MObject* exception = nullptr;").AppendLine(); if (paramsCount == 0) contents.AppendLine(" void** params = nullptr;");