mirror of
https://github.com/DCFApixels/Unity-DebugX.git
synced 2025-09-17 17:34:35 +08:00
fix
This commit is contained in:
parent
887b6dadb9
commit
e564799ffa
@ -277,9 +277,11 @@ namespace DCFApixels
|
||||
_material = material;
|
||||
_matrices = PinnedArray<Matrix4x4>.Pin(DummyArray<Matrix4x4>.Get());
|
||||
_colors = PinnedArray<Vector4>.Pin(DummyArray<Vector4>.Get());
|
||||
|
||||
#if UNITY_EDITOR
|
||||
AssemblyReloadEvents.beforeAssemblyReload += AssemblyReloadEvents_beforeAssemblyReload;
|
||||
#endif
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
private void AssemblyReloadEvents_beforeAssemblyReload()
|
||||
{
|
||||
AssemblyReloadEvents.beforeAssemblyReload -= AssemblyReloadEvents_beforeAssemblyReload;
|
||||
@ -288,6 +290,7 @@ namespace DCFApixels
|
||||
_colors.Dispose();
|
||||
_gizmos.Dispose();
|
||||
}
|
||||
#endif
|
||||
public void Prepare(GizmosList rawList)
|
||||
{
|
||||
var list = rawList.As<GizmoData>();
|
||||
@ -390,9 +393,11 @@ namespace DCFApixels
|
||||
_materialPropertyBlock = new MaterialPropertyBlock();
|
||||
_drawDatas = PinnedArray<DrawData>.Pin(DummyArray<DrawData>.Get());
|
||||
_enableInstancing = IsSupportsComputeShaders && _material.GetMaterial().enableInstancing;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
AssemblyReloadEvents.beforeAssemblyReload += AssemblyReloadEvents_beforeAssemblyReload;
|
||||
#endif
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
private void AssemblyReloadEvents_beforeAssemblyReload()
|
||||
{
|
||||
AssemblyReloadEvents.beforeAssemblyReload -= AssemblyReloadEvents_beforeAssemblyReload;
|
||||
@ -402,7 +407,7 @@ namespace DCFApixels
|
||||
_drawDatas.Dispose();
|
||||
_gizmos.Dispose();
|
||||
}
|
||||
|
||||
#endif
|
||||
public virtual int ExecuteOrder => _material.GetExecuteOrder();
|
||||
public virtual bool IsStaticRender => true;
|
||||
protected void Prepare(GizmosList rawList)
|
||||
@ -519,9 +524,11 @@ namespace DCFApixels
|
||||
_materialPropertyBlock = new MaterialPropertyBlock();
|
||||
_drawDatas = PinnedArray<DrawData>.Pin(DummyArray<DrawData>.Get());
|
||||
_enableInstancing = IsSupportsComputeShaders && _material.GetMaterial().enableInstancing;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
AssemblyReloadEvents.beforeAssemblyReload += AssemblyReloadEvents_beforeAssemblyReload;
|
||||
#endif
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
private void AssemblyReloadEvents_beforeAssemblyReload()
|
||||
{
|
||||
AssemblyReloadEvents.beforeAssemblyReload -= AssemblyReloadEvents_beforeAssemblyReload;
|
||||
@ -531,6 +538,7 @@ namespace DCFApixels
|
||||
_drawDatas.Dispose();
|
||||
_gizmos.Dispose();
|
||||
}
|
||||
#endif
|
||||
public virtual int ExecuteOrder => _material.GetExecuteOrder() - 1;
|
||||
public virtual bool IsStaticRender => true;
|
||||
public void Prepare(GizmosList rawList)
|
||||
|
@ -1,9 +1,9 @@
|
||||
using DCFApixels.DebugXCore;
|
||||
using System.Runtime.CompilerServices;
|
||||
//#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
//#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
//#endif
|
||||
|
||||
namespace DCFApixels
|
||||
@ -213,7 +213,11 @@ namespace DCFApixels
|
||||
Vector3 pos1 = camera.WorldToScreenPoint(cameraPos + cameraTransform.TransformDirection(new Vector3(0f, 0f, z)));
|
||||
Vector3 pos2 = camera.WorldToScreenPoint(cameraPos + cameraTransform.TransformDirection(new Vector3(1f, 0f, z)));
|
||||
float magnitude = (pos1 - pos2).magnitude;
|
||||
#if UNITY_EDITOR
|
||||
return 80f / Mathf.Max(magnitude, 0.0001f) * EditorGUIUtility.pixelsPerPoint;
|
||||
#else
|
||||
return 80f / Mathf.Max(magnitude, 0.0001f);
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user