From dcd2f401fcdf4b895a32533c314e0dc897b315c9 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:49:52 +0800 Subject: [PATCH 01/14] replace CBExecutor with ICommandBufferExecutor --- Runtime/DebugX.cs | 55 +++++++--------------- Runtime/Internal/CommandBufferExecutors.cs | 43 +++++++++++++++++ 2 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 Runtime/Internal/CommandBufferExecutors.cs diff --git a/Runtime/DebugX.cs b/Runtime/DebugX.cs index bf897aa..891e2ad 100644 --- a/Runtime/DebugX.cs +++ b/Runtime/DebugX.cs @@ -18,8 +18,8 @@ using UnityEditor; namespace DCFApixels { - using IN = System.Runtime.CompilerServices.MethodImplAttribute; using static DebugXConsts; + using IN = System.Runtime.CompilerServices.MethodImplAttribute; public static unsafe partial class DebugX { private static PauseStateX _pauseState = PauseStateX.Unpaused; @@ -33,6 +33,16 @@ namespace DCFApixels private static ulong _renderTicks = 100; private static ulong _timeTicks = 0; + public static ulong RenderTicks + { + get { return _renderTicks; } + } + public static ulong TimeTicks + { + get { return _timeTicks; } + } + + #region Other public static void ClearAllGizmos() { @@ -212,7 +222,7 @@ namespace DCFApixels } private static void OnPostRender_SRP(ScriptableRenderContext context, Camera camera) { - PostRender_General(new CBExecutor(context), camera); + PostRender_General(CommandBufferExecutorSRP.GetInstance(context), camera); context.Submit(); } private static void OnPreRender_BRP(Camera camera) @@ -222,20 +232,10 @@ namespace DCFApixels } private static void OnPostRender_BRP(Camera camera) { - PostRender_General(default, camera); + PostRender_General(CommandBufferExecutorBRP.GetInstance(), camera); //throw new NotImplementedException(); } - - public static ulong RenderTicks - { - get { return _renderTicks; } - } - public static ulong TimeTicks - { - get { return _timeTicks; } - } - private static void PreUpdateCallback() { _editorTicks++; @@ -289,7 +289,7 @@ namespace DCFApixels } - private static void PostRender_General(CBExecutor cbExecutor, Camera camera) + private static void PostRender_General(ICommandBufferExecutor cbExecutor, Camera camera) { if (_lastEditorTicks != _editorTicks) { @@ -309,25 +309,6 @@ namespace DCFApixels contextController.Prepare(); contextController.Render(cbExecutor); } - private readonly struct CBExecutor - { - public readonly ScriptableRenderContext RenderContext; - public CBExecutor(ScriptableRenderContext renderContext) - { - RenderContext = renderContext; - } - public void Execute(CommandBuffer cb) - { - if (RenderContext == default) - { - Graphics.ExecuteCommandBuffer(cb); - } - else - { - RenderContext.ExecuteCommandBuffer(cb); - } - } - } #if UNITY_EDITOR @@ -411,7 +392,7 @@ namespace DCFApixels } return _currenRenderContextControler; } -#endregion + #endregion #region RenderContextControler @@ -567,7 +548,7 @@ namespace DCFApixels } [IN(LINE)] - public void Render(CBExecutor cbExecutor) + public void Render(ICommandBufferExecutor cbExecutor) { #if UNITY_EDITOR using (_cameraMarker.Auto()) @@ -621,7 +602,7 @@ namespace DCFApixels public abstract int ExecuteOrder { get; } public abstract int UpdateTimer(float deltaTime); public abstract void Prepare(); - public abstract void Render(CBExecutor cbExecutor); + public abstract void Render(ICommandBufferExecutor cbExecutor); public abstract void Render_UnityGizmos(); public abstract int RunEnd(); public abstract void Clear(); @@ -769,7 +750,7 @@ namespace DCFApixels } } private ulong _renderLastRenderTicks = 0; - public override void Render(CBExecutor cbExecutor) + public override void Render(ICommandBufferExecutor cbExecutor) { if (_gizmos.Count <= 0) { return; } #if DEV_MODE diff --git a/Runtime/Internal/CommandBufferExecutors.cs b/Runtime/Internal/CommandBufferExecutors.cs new file mode 100644 index 0000000..af78f59 --- /dev/null +++ b/Runtime/Internal/CommandBufferExecutors.cs @@ -0,0 +1,43 @@ +using System; +using UnityEngine; +using UnityEngine.Rendering; + +namespace DCFApixels.DebugXCore.Internal +{ + internal interface ICommandBufferExecutor + { + void Execute(CommandBuffer cb); + } + internal class CommandBufferExecutorSRP : ICommandBufferExecutor + { + [ThreadStatic] + private static CommandBufferExecutorSRP _instance = new CommandBufferExecutorSRP(); + public static CommandBufferExecutorSRP GetInstance(ScriptableRenderContext context) + { + if (_instance == null) { _instance = new CommandBufferExecutorSRP(); } + _instance.RenderContext = context; + return _instance; + } + public ScriptableRenderContext RenderContext; + private CommandBufferExecutorSRP() { } + public void Execute(CommandBuffer cb) + { + RenderContext.ExecuteCommandBuffer(cb); + } + } + internal class CommandBufferExecutorBRP : ICommandBufferExecutor + { + [ThreadStatic] + private static CommandBufferExecutorBRP _instance = new CommandBufferExecutorBRP(); + public static CommandBufferExecutorBRP GetInstance() + { + if (_instance == null) { _instance = new CommandBufferExecutorBRP(); } + return _instance; + } + private CommandBufferExecutorBRP() { } + public void Execute(CommandBuffer cb) + { + Graphics.ExecuteCommandBuffer(cb); + } + } +} \ No newline at end of file From 8f5629623d684056297e211c5582ae9c654e7997 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:50:00 +0800 Subject: [PATCH 02/14] add new gizmos --- Runtime/Gizmos/DebugX.primitives.cs | 147 +++++- Runtime/Meshes/Cone.asset | 167 +++++++ Runtime/Meshes/Cone.asset.meta | 8 + Runtime/Meshes/Cylinder.asset | 167 +++++++ Runtime/Meshes/Cylinder.asset.meta | 8 + Runtime/Meshes/DotDiamond.asset | 6 +- Runtime/Meshes/Triangle.asset | 167 +++++++ Runtime/Meshes/Triangle.asset.meta | 8 + Runtime/Meshes/WireDotDiamond.asset | 167 +++++++ Runtime/Meshes/WireDotDiamond.asset.meta | 8 + .../DCFApixels.DebugX/MeshesList.prefab | 375 +++++++++++++- Runtime/Utils/DebugXAssets.cs | 4 + Runtime/Utils/StaticData.cs | 16 + Samples/Sample.unity | 465 +++++++++++++++++- Samples/Scripts/DebugXSample_Other.cs | 3 + Samples/Scripts/DebugXSample_Primitives2D.cs | 5 + Samples/Scripts/DebugXSample_Primitives3D.cs | 5 + 17 files changed, 1692 insertions(+), 34 deletions(-) create mode 100644 Runtime/Meshes/Cone.asset create mode 100644 Runtime/Meshes/Cone.asset.meta create mode 100644 Runtime/Meshes/Cylinder.asset create mode 100644 Runtime/Meshes/Cylinder.asset.meta create mode 100644 Runtime/Meshes/Triangle.asset create mode 100644 Runtime/Meshes/Triangle.asset.meta create mode 100644 Runtime/Meshes/WireDotDiamond.asset create mode 100644 Runtime/Meshes/WireDotDiamond.asset.meta diff --git a/Runtime/Gizmos/DebugX.primitives.cs b/Runtime/Gizmos/DebugX.primitives.cs index 30026c4..ce83a8c 100644 --- a/Runtime/Gizmos/DebugX.primitives.cs +++ b/Runtime/Gizmos/DebugX.primitives.cs @@ -1,13 +1,13 @@ //#undef DEBUG +using DCFApixels.DebugXCore; using System; using UnityEngine; using UnityEngine.Rendering; -using DCFApixels.DebugXCore; namespace DCFApixels { - using IN = System.Runtime.CompilerServices.MethodImplAttribute; using static DebugXConsts; + using IN = System.Runtime.CompilerServices.MethodImplAttribute; public unsafe static partial class DebugX { public readonly partial struct DrawHandler @@ -21,7 +21,7 @@ namespace DCFApixels #endregion #region DotCross - [IN(LINE)] public DrawHandler DotCross(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(0.06f, 0.06f, 0.06f)); + [IN(LINE)] public DrawHandler DotCross(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(0.06f, 0.06f, 1f)); #endregion @@ -123,11 +123,127 @@ namespace DCFApixels #endregion #region Dot - [IN(LINE)] public DrawHandler Dot(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE, DOT_SIZE, DOT_SIZE)); + [IN(LINE)] public DrawHandler Dot(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE, DOT_SIZE, 1f)); #endregion #region WireDot - [IN(LINE)] public DrawHandler WireDot(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE / 2, DOT_SIZE / 2, DOT_SIZE / 2)); + [IN(LINE)] public DrawHandler WireDot(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE * 0.5f, DOT_SIZE * 0.5f, 1f)); + #endregion + + + #region Cylinder + [IN(LINE)] + public DrawHandler Cylinder(Vector3 position, Quaternion rotation, float radius, float height) + { + Mesh(position, rotation * Quaternion.Euler(-90, 0, 0), new Vector3(radius * 2f, radius * 2f, height)); + return this; + } + #endregion + + #region WireCylinder + [IN(LINE)] + public DrawHandler WireCylinder(Vector3 position, Quaternion rotation, float radius, float height) + { + var halfHeigth = height * 0.5f; + var normalUp = rotation * Vector3.up; + + var center = position; + + Vector3 start, end; + start = center - normalUp * halfHeigth; + end = center + normalUp * halfHeigth; + + WireCircle(start, rotation * Quaternion.Euler(90, 0, 0), radius); + WireCircle(end, rotation * Quaternion.Euler(90, 0, 0), radius); + + var normalForward = rotation * Vector3.forward; + Vector3 from = Vector3.Cross(normalForward, normalUp).normalized; + Vector3 perpendicular = from * radius; + normalForward *= radius; + + Vector3* lines = stackalloc Vector3[] + { + start - perpendicular, + end - perpendicular, + start + perpendicular, + end + perpendicular, + start - normalForward, + end - normalForward, + start + normalForward, + end + normalForward, + }; + + Line(lines[0], lines[1]); + Line(lines[2], lines[3]); + Line(lines[4], lines[5]); + Line(lines[6], lines[7]); + + return this; + } + #endregion + + #region Cone + [IN(LINE)] + public DrawHandler Cone(Vector3 position, Quaternion rotation, float radius, float height) + { + Mesh(position, rotation * Quaternion.Euler(-90, 0, 0), new Vector3(radius * 2f, radius * 2f, height)); + return this; + } + #endregion + + #region WireCone + [IN(LINE)] + public DrawHandler WireCone(Vector3 position, Quaternion rotation, float radius, float height) + { + var halfHeigth = height * 0.5f; + var normalUp = rotation * Vector3.up; + + var center = position; + + Vector3 start, end; + start = center - normalUp * halfHeigth; + end = center + normalUp * halfHeigth; + + WireCircle(start, rotation * Quaternion.Euler(90, 0, 0), radius); + + var normalForward = rotation * Vector3.forward; + Vector3 from = Vector3.Cross(normalForward, normalUp).normalized; + Vector3 perpendicular = from * radius; + normalForward *= radius; + + Vector3* lines = stackalloc Vector3[] + { + start - perpendicular, + start + perpendicular, + start - normalForward, + start + normalForward, + }; + + Line(lines[0], end); + Line(lines[1], end); + Line(lines[2], end); + Line(lines[3], end); + + return this; + } + #endregion + + #region Triangle + [IN(LINE)] + public DrawHandler Triangle(Vector3 position, Quaternion rotation, Vector2 size) + { + Mesh(position, rotation, new Vector3(size.x, size.y, 1f)); + return this; + } + #endregion + + #region WireTriangle + [IN(LINE)] + public DrawHandler WireTriangle(Vector3 position, Quaternion rotation, Vector2 size) + { + Mesh(position, rotation, new Vector3(size.x, size.y, 1f)); + return this; + } #endregion #region Capsule @@ -200,17 +316,17 @@ namespace DCFApixels { height -= radius * 2f; - var normalForward = rotation * Vector3.forward; var normalUp = rotation * Vector3.up; var halfHeigth = height * 0.5f; - Vector3 from = Vector3.Cross(normalForward, normalUp).normalized; Vector3 start = position - normalUp * halfHeigth; Vector3 end = position + normalUp * halfHeigth; Mesh(end, rotation, new Vector3(radius, radius, radius)); Mesh(start, rotation * Rot180, new Vector3(radius, radius, radius)); + var normalForward = rotation * Vector3.forward; + Vector3 from = Vector3.Cross(normalForward, normalUp).normalized; Vector3 perpendicular = from * radius; Vector3* lines = stackalloc Vector3[] @@ -228,6 +344,7 @@ namespace DCFApixels } #endregion + #region Cube //[IN(LINE)] public void Cube(Vector3 position, float size) => Cube(position, Quaternion.identity, new Vector3(size, size, size)); //[IN(LINE)] public void Cube(Vector3 position, Vector3 size) => Cube(position, Quaternion.identity, size); @@ -329,8 +446,8 @@ namespace DCFApixels #region Quad //[IN(LINE)] public DrawHandler Quad(Vector3 position, Vector3 normal, float size) => Mesh(Meshes.Quad, position, Quaternion.LookRotation(normal), new Vector3(size, size, size)); //[IN(LINE)] public DrawHandler Quad(Vector3 position, Vector3 normal, Vector2 size) => Mesh(Meshes.Quad, position, Quaternion.LookRotation(normal), size); - [IN(LINE)] public DrawHandler Quad(Vector3 position, Quaternion rotation, float size) => Mesh(position, rotation, new Vector3(size, size, 0.0000000001f)); //TODO fix quad mesh - [IN(LINE)] public DrawHandler Quad(Vector3 position, Quaternion rotation, Vector2 size) => Mesh(position, rotation, new Vector3(size.x, size.y, 0.0000000001f)); //TODO fix quad mesh + [IN(LINE)] public DrawHandler Quad(Vector3 position, Quaternion rotation, float size) => Mesh(position, rotation, new Vector3(size, size, 1f)); //TODO fix quad mesh + [IN(LINE)] public DrawHandler Quad(Vector3 position, Quaternion rotation, Vector2 size) => Mesh(position, rotation, new Vector3(size.x, size.y, 1f)); //TODO fix quad mesh #endregion #region WireQuad @@ -397,11 +514,19 @@ namespace DCFApixels #endregion #region DotQuad - [IN(LINE)] public DrawHandler DotQuad(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE, DOT_SIZE, DOT_SIZE)); + [IN(LINE)] public DrawHandler DotQuad(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE, DOT_SIZE, 1f)); + #endregion + + #region WireDotQuad + [IN(LINE)] public DrawHandler WireDotQuad(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE, DOT_SIZE, 0f)); #endregion #region DotDiamond - [IN(LINE)] public DrawHandler DotDiamond(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE * 0.9f, DOT_SIZE * 0.9f, DOT_SIZE * 0.9f)); + [IN(LINE)] public DrawHandler DotDiamond(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE * 1.16f, DOT_SIZE * 1.16f, 1f)); + #endregion + + #region WireDotDiamond + [IN(LINE)] public DrawHandler WireDotDiamond(Vector3 position) => Mesh(position, Quaternion.identity, new Vector3(DOT_SIZE * 1.16f, DOT_SIZE * 1.16f, 1f)); #endregion } } diff --git a/Runtime/Meshes/Cone.asset b/Runtime/Meshes/Cone.asset new file mode 100644 index 0000000..9d7f10d --- /dev/null +++ b/Runtime/Meshes/Cone.asset @@ -0,0 +1,167 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!43 &4300000 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Cone + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 90 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 64 + localAABB: + m_Center: {x: 0, y: 0.000000059604645, z: -0.000000029802322} + m_Extent: {x: 0.49999997, y: 0.5, z: 0.5} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 1 + m_KeepIndices: 1 + m_IndexFormat: 0 + m_IndexBuffer: 00000100020003000400050006000700080009000a000b000c000d000e000f0010001100120013001400150016001700180019001a001b001c001d001e001f0020002100220023002400250026002700280029002a002b002c002d002e002f0030003100320032003300300032003400330034003500330034003600350036003700350036003800370038003900370039003a00370039003b003a0039003c003b003c003d003b003c003e003d003e003f003d00 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 64 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 24 + format: 0 + dimension: 4 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 2560 + _typelessdata: 000000000100003ffeffffbea95d33beef6e613ff46ee13e35de6dbf000000008542bdbe000080bf15ef43be6183ec3efeffffbea95d33beef6e613ff46ee13e35de6dbf000000008542bdbe000080bf000000a5692122b30000003fa95d33beef6e613ff46ee13e35de6dbf000000008642bdbe000080bf15ef43be6183ec3efeffffbe4065ffbef51c3f3ff46ee13e2c6929bf0000000050ed3fbf000080bff204b5bef504b53efeffffbe4065ffbef51c3f3ff46ee13e2b6929bf0000000051ed3fbf000080bf000000a5692122b30000003f4065ffbef51c3f3ff46ee13e2c6929bf0000000051ed3fbf000080bff204b5bef504b53efeffffbef91c3fbf3b65ff3ef16ee13e420d02bf0000000054815cbf000080bf5d83ecbe1bef433e000000bff91c3fbf3b65ff3ef16ee13e420d02bf0000000054815cbf000080bf000000a5692122b30000003ff91c3fbf3b65ff3ef16ee13e420d02bf0000000054815cbf000080bf5d83ecbe1bef433e000000bfef6e61bfae5d333eef6ee13e2ef9e4be000000002ef964bf000080bfffffffbe69212233000000bfef6e61bfae5d333eef6ee13e2ef9e4be000000002ef964bf000080bf000000a5692122b30000003fef6e61bfae5d333eef6ee13e2ef9e4be000000002ef964bf000080bfffffffbe69212233000000bfef6e61bfb25d33beee6ee13e2ef9e4be000000002ef964bf000080bf5d83ecbe11ef43be000000bfef6e61bfb25d33beee6ee13e2cf9e4be000000002ef964bf000080bf000000a5692122b30000003fef6e61bfb25d33beee6ee13e2ef9e4be000000002ef964bf000080bf5d83ecbe11ef43be000000bffa1c3fbf3e65ffbeee6ee13e410d02bf0000000054815cbf000080bff204b5bef104b5be000000bffa1c3fbf3e65ffbeee6ee13e410d02bf0000000054815cbf000080bf000000a5692122b30000003ffa1c3fbf3e65ffbeee6ee13e410d02bf0000000054815cbf000080bff204b5bef104b5be000000bf3b65ffbefa1c3fbfeb6ee13e2a6929bf0000000052ed3fbf000080bf15ef43be5c83ecbe010000bf3b65ffbefa1c3fbfeb6ee13e2a6929bf0000000052ed3fbf000080bf000000a5692122b30000003f3b65ffbefa1c3fbfeb6ee13e2a6929bf0000000052ed3fbf000080bf15ef43be5c83ecbe010000bfb25d33bef16e61bfee6ee13e38de6dbf000000007642bdbe000080bf00008025feffffbe010000bfb25d33bef16e61bfee6ee13e38de6dbf000000007642bdbe000080bf000000a5692122b30000003fb25d33bef16e61bfee6ee13e36de6dbf000000007542bdbe000080bf00008025feffffbe010000bfb25d333ef16e61bfee6ee13e38de6dbf000000007442bd3e000080bf15ef433e5c83ecbe010000bfb25d333ef16e61bfee6ee13e38de6dbf000000007542bd3e000080bf000000a5692122b30000003fb25d333ef16e61bfee6ee13e38de6dbf000000007442bd3e000080bf15ef433e5c83ecbe010000bf3b65ff3efa1c3fbfeb6ee13e2b6929bf0000000051ed3f3f000080bff204b53ef104b5be000000bf3b65ff3efa1c3fbfeb6ee13e2a6929bf0000000051ed3f3f000080bf000000a5692122b30000003f3b65ff3efa1c3fbfeb6ee13e2a6929bf0000000051ed3f3f000080bff204b53ef104b5be000000bff91c3f3f3c65ffbeee6ee13e420d02bf0000000054815c3f000080bf5d83ec3e11ef43be000000bff91c3f3f3c65ffbeee6ee13e420d02bf0000000054815c3f000080bf000000a5692122b30000003ff91c3f3f3c65ffbeee6ee13e420d02bf0000000054815c3f000080bf5d83ec3e11ef43be000000bfef6e613fb25d33beee6ee13e2cf9e4be000000002ef9643f000080bfffffff3e69212233000000bfef6e613fb25d33beee6ee13e2ef9e4be000000002ef9643f000080bf000000a5692122b30000003fef6e613fb25d33beee6ee13e2ef9e4be000000002ef9643f000080bfffffff3e69212233000000bfef6e613fae5d333eef6ee13e2ef9e4be000000002ef9643f000080bf5d83ec3e1bef433e000000bfef6e613fae5d333eef6ee13e2ef9e4be000000002ef9643f000080bf000000a5692122b30000003fef6e613fae5d333eef6ee13e2ef9e4be000000002ef9643f000080bf5d83ec3e1bef433e000000bff91c3f3f3b65ff3ef26ee13e410d02bf0000000054815c3f000080bff204b53ef504b53efeffffbef91c3f3f3b65ff3ef26ee13e410d02bf0000000055815c3f000080bf000000a5692122b30000003ff91c3f3f3b65ff3ef26ee13e420d02bf0000000054815c3f000080bff204b53ef504b53efeffffbe4065ff3ef51c3f3ff46ee13e2b6929bf0000000051ed3f3f000080bf15ef433e6183ec3efeffffbe4065ff3ef51c3f3ff46ee13e2c6929bf0000000050ed3f3f000080bf000000a5692122b30000003f4065ff3ef51c3f3ff46ee13e2c6929bf0000000051ed3f3f000080bf15ef433e6183ec3efeffffbea95d333eef6e613ff46ee13e35de6dbf000000008442bd3e000080bf000000000100003ffeffffbea95d333eef6e613ff46ee13e35de6dbf000000008442bd3e000080bf000000a5692122b30000003fa95d333eef6e613ff46ee13e35de6dbf000000008442bd3e000080bf5d83ecbe11ef43be000000bf0000000000000000000080bf000080bf00000000000000000000803fffffffbe69212233000000bf0000000000000000000080bf000080bf00000000000000000000803f5d83ecbe1bef433e000000bf0000000000000000000080bf000080bf00000000000000000000803ff204b5bef104b5be000000bf0000000000000000000080bf000080bf00000000000000000000803ff204b5bef504b53efeffffbe0000000000000000000080bf000080bf00000000000000000000803f15ef43be5c83ecbe010000bf0000000000000000000080bf000080bf00000000000000000000803f15ef43be6183ec3efeffffbe0000000000000000000080bf000080bf00000000000000000000803f00008025feffffbe010000bf0000000000000000000080bf000080bf00000000000000000000803f000000000100003ffeffffbe0000000000000000000080bf000080bf00000000000000000000803f15ef433e6183ec3efeffffbe0000000000000000000080bf000080bf00000000000000000000803f15ef433e5c83ecbe010000bf0000000000000000000080bf000080bf00000000000000000000803ff204b53ef104b5be000000bf0000000000000000000080bf000080bf00000000000000000000803ff204b53ef504b53efeffffbe0000000000000000000080bf000080bf00000000000000000000803f5d83ec3e11ef43be000000bf0000000000000000000080bf000080bf00000000000000000000803f5d83ec3e1bef433e000000bf0000000000000000000080bf000080bf00000000000000000000803fffffff3e69212233000000bf0000000000000000000080bf000080bf00000000000000000000803f + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0.000000059604645, z: -0.000000029802322} + m_Extent: {x: 0.49999997, y: 0.5, z: 0.5} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: diff --git a/Runtime/Meshes/Cone.asset.meta b/Runtime/Meshes/Cone.asset.meta new file mode 100644 index 0000000..fd81efc --- /dev/null +++ b/Runtime/Meshes/Cone.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 58c1d6dfb1981574595c1b1601525ab2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4300000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Meshes/Cylinder.asset b/Runtime/Meshes/Cylinder.asset new file mode 100644 index 0000000..0e1fbcb --- /dev/null +++ b/Runtime/Meshes/Cylinder.asset @@ -0,0 +1,167 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!43 &4300000 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Cylinder + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 180 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 66 + localAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.49999997, y: 0.50000006, z: 0.50000006} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 1 + m_KeepIndices: 1 + m_IndexFormat: 0 + m_IndexBuffer: 00000100020000000300010003000400010003000500040005000600040005000700060007000800060007000900080009000a00080009000b000a000b000c000a000b000d000c000d000e000c000d000f000e000f0010000e000f001100100011001200100011001300120013001400120013001500140015001600140015001700160017001800160017001900180019001a00180019001b001a001b001c001a001b001d001c001d001e001c001d001f001e001f0020001e001f002100200022002300240024002500220024002600250026002700250026002800270028002900270028002a0029002a002b0029002b002c0029002b002d002c002b002e002d002e002f002d002e0030002f00300031002f0032003300340034003500320034003600350036003700350036003800370038003900370038003a0039003a003b0039003a003c003b003c003d003b003c003e003d003e003f003d003e0040003f00400041003f00 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 66 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 24 + format: 0 + dimension: 4 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 2640 + _typelessdata: 000040b10100003ffeffffbe000000000000803f000000000000803f0000000000000000000080bf15ef43be5c83ec3e0100003f16efc3be5e836c3f000000005e836c3f16efc33e00000000000080bffeff3fb1feffff3e0100003f000000000000803f000000000000803f0000000000000000000080bf15ef43be6183ec3efeffffbe18efc3be5e836c3f000000005e836c3f17efc33e00000000000080bff204b5bef104b53e0000003ff40435bff104353f00000000f104353ff404353f00000000000080bff204b5bef504b53efeffffbef40435bff104353f00000000f204353ff304353f00000000000080bf5d83ecbe11ef433e0000003f5e836cbf16efc33e0000000016efc33e5e836c3f00000000000080bf5d83ecbe1bef433e000000bf5e836cbf15efc33e0000000015efc33e5e836c3f00000000000080bfffffffbe692122b30000003f000080bf0000000000000000000000000000803f00000000000080bfffffffbe69212233000000bf000080bf0000000000000000000000000000803f00000000000080bf5d83ecbe1bef43be0000003f5e836cbf15efc3be0000000015efc3be5e836c3f00000000000080bf5d83ecbe11ef43be000000bf5e836cbf16efc3be0000000015efc3be5e836c3f00000000000080bff204b5bef504b5befeffff3ef40435bff10435bf00000000f10435bff404353f00000000000080bff204b5bef104b5be000000bff40435bff10435bf00000000f20435bff304353f00000000000080bf15ef43be6183ecbefeffff3e16efc3be5e836cbf000000005e836cbf15efc33e00000000000080bf15ef43be5c83ecbe010000bf16efc3be5e836cbf000000005e836cbf16efc33e00000000000080bf000040b1010000bffeffff3e00000000000080bf00000000000080bf0000000000000000000080bf020040b1feffffbe010000bf00000000000080bf00000000000080bf0000000000000000000080bf15ef433e6183ecbefeffff3e18efc33e5e836cbf000000005e836cbf18efc3be00000000000080bf15ef433e5c83ecbe010000bf16efc33e5e836cbf000000005e836cbf17efc3be00000000000080bff204b53ef504b5befeffff3ef404353ff10435bf00000000f20435bff30435bf00000000000080bff204b53ef104b5be000000bff404353ff10435bf00000000f20435bff30435bf00000000000080bf5d83ec3e1bef43be0000003f5e836c3f15efc3be0000000015efc3be5e836cbf00000000000080bf5d83ec3e11ef43be000000bf5e836c3f16efc3be0000000016efc3be5e836cbf00000000000080bfffffff3e692122b30000003f0000803f000000000000000000000000000080bf00000000000080bfffffff3e69212233000000bf0000803f000000000000000000000000000080bf00000000000080bf5d83ec3e11ef433e0000003f5e836c3f16efc33e0000000016efc33e5e836cbf00000000000080bf5d83ec3e1bef433e000000bf5e836c3f15efc33e0000000016efc33e5e836cbf00000000000080bff204b53ef104b53e0000003ff404353ff104353f00000000f204353ff30435bf00000000000080bff204b53ef504b53efeffffbef404353ff104353f00000000f204353ff30435bf00000000000080bf15ef433e5c83ec3e0100003f16efc33e5e836c3f000000005e836c3f16efc3be00000000000080bf15ef433e6183ec3efeffffbe16efc33e5e836c3f000000005e836c3f16efc3be00000000000080bffeff3fb1feffff3e0100003f000000000000803f000000000000803f0000000000000000000080bf000040b10100003ffeffffbe000000000000803f000000000000803f0000000000000000000080bf5d83ecbe11ef433e0000003f00000000000000000000803f000080bf0000000000000000000080bfffffffbe692122b30000003f00000000000000000000803f000080bf0000000000000000000080bf5d83ecbe1bef43be0000003f00000000000000000000803f000080bf0000000000000000000080bff204b5bef104b53e0000003f00000000000000000000803f000080bf0000000000000000000080bff204b5bef504b5befeffff3e00000000000000000000803f000080bf0000000000000000000080bf15ef43be5c83ec3e0100003f00000000000000000000803f000080bf0000000000000000000080bf15ef43be6183ecbefeffff3e00000000000000000000803f000080bf0000000000000000000080bffeff3fb1feffff3e0100003f00000000000000000000803f000080bf0000000000000000000080bf000040b1010000bffeffff3e00000000000000000000803f000080bf0000000000000000000080bf15ef433e6183ecbefeffff3e00000000000000000000803f000080bf0000000000000000000080bf15ef433e5c83ec3e0100003f00000000000000000000803f000080bf0000000000000000000080bff204b53ef104b53e0000003f00000000000000000000803f000080bf0000000000000000000080bff204b53ef504b5befeffff3e00000000000000000000803f000080bf0000000000000000000080bf5d83ec3e11ef433e0000003f00000000000000000000803f000080bf0000000000000000000080bf5d83ec3e1bef43be0000003f00000000000000000000803f000080bf0000000000000000000080bfffffff3e692122b30000003f00000000000000000000803f000080bf0000000000000000000080bf5d83ecbe11ef43be000000bf0000000000000000000080bf000080bf00000000000000000000803fffffffbe69212233000000bf0000000000000000000080bf000080bf00000000000000000000803f5d83ecbe1bef433e000000bf0000000000000000000080bf000080bf00000000000000000000803ff204b5bef104b5be000000bf0000000000000000000080bf000080bf00000000000000000000803ff204b5bef504b53efeffffbe0000000000000000000080bf000080bf00000000000000000000803f15ef43be5c83ecbe010000bf0000000000000000000080bf000080bf00000000000000000000803f15ef43be6183ec3efeffffbe0000000000000000000080bf000080bf00000000000000000000803f020040b1feffffbe010000bf0000000000000000000080bf000080bf00000000000000000000803f000040b10100003ffeffffbe0000000000000000000080bf000080bf00000000000000000000803f15ef433e5c83ecbe010000bf0000000000000000000080bf000080bf00000000000000000000803f15ef433e6183ec3efeffffbe0000000000000000000080bf000080bf00000000000000000000803ff204b53ef104b5be000000bf0000000000000000000080bf000080bf00000000000000000000803ff204b53ef504b53efeffffbe0000000000000000000080bf000080bf00000000000000000000803f5d83ec3e11ef43be000000bf0000000000000000000080bf000080bf00000000000000000000803f5d83ec3e1bef433e000000bf0000000000000000000080bf000080bf00000000000000000000803fffffff3e69212233000000bf0000000000000000000080bf000080bf00000000000000000000803f + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.49999997, y: 0.50000006, z: 0.50000006} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: diff --git a/Runtime/Meshes/Cylinder.asset.meta b/Runtime/Meshes/Cylinder.asset.meta new file mode 100644 index 0000000..7d8fd57 --- /dev/null +++ b/Runtime/Meshes/Cylinder.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e6ab4bd9eac93c345a4f02aa6e81b160 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4300000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Meshes/DotDiamond.asset b/Runtime/Meshes/DotDiamond.asset index 9e1a3db..7aa37e7 100644 --- a/Runtime/Meshes/DotDiamond.asset +++ b/Runtime/Meshes/DotDiamond.asset @@ -18,7 +18,7 @@ Mesh: vertexCount: 4 localAABB: m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0.7071068, y: 0.7071068, z: 0.000000096981736} + m_Extent: {x: 0.49999952, y: 0.49999952, z: 0.00000005742529} m_Shapes: vertices: [] shapes: [] @@ -97,7 +97,7 @@ Mesh: format: 0 dimension: 0 m_DataSize: 160 - _typelessdata: f404353f000080324644d0b30000000000000000000080bff30435bff304353f00000000000080bf00000033f40435bf34ce32320000000000000000000080bff30435bff204353f00000000000080bff40435bf000040b34644d0330000000000000000000080bff30435bff304353f00000000000080bf000000b3f404353f34ce32b20000000000000000000080bff30435bff304353f00000000000080bf + _typelessdata: f0ffff3eeb04b53214064cb30000000000000000000080bff30435bff304353f00000000000080bfe904b5b2f0ffffbec6a376b30000000000000000000080bff20435bff304353f00000000000080bff0ffffbeeb04b5b214064c330000000000000000000080bff30435bff304353f00000000000080bfe904b532f0ffff3ec6a376330000000000000000000080bff30435bff304353f00000000000080bf m_CompressedMesh: m_Vertices: m_NumItems: 0 @@ -152,7 +152,7 @@ Mesh: m_UVInfo: 0 m_LocalAABB: m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0.7071068, y: 0.7071068, z: 0.000000096981736} + m_Extent: {x: 0.49999952, y: 0.49999952, z: 0.00000005742529} m_MeshUsageFlags: 0 m_CookingOptions: 30 m_BakedConvexCollisionMesh: diff --git a/Runtime/Meshes/Triangle.asset b/Runtime/Meshes/Triangle.asset new file mode 100644 index 0000000..873c116 --- /dev/null +++ b/Runtime/Meshes/Triangle.asset @@ -0,0 +1,167 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!43 &4300000 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Triangle + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 6 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 6 + localAABB: + m_Center: {x: 0.000000044703484, y: 0, z: 0} + m_Extent: {x: 0.49999994, y: 0.5, z: 0.0000001718594} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 1 + m_KeepIndices: 1 + m_IndexFormat: 0 + m_IndexBuffer: 000001000200030004000500 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 6 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 24 + format: 0 + dimension: 4 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 240 + _typelessdata: fdffffbe000000bf5a8838b40000000000000000000080bf0000803f0000000000000000000080bf2ebd3bb30000003f5a8838340000000000000000000080bf0000803f0000000000000000000080bf0000003f000000bf5a8838b40000000000000000000080bf0000803f0000000000000000000080bffdffffbe000000bf4cefce3300000000000000000000803f0000803f00000000000000000000803f0000003f000000bf4cefce3300000000000000000000803f0000803f00000000000000000000803f2ebd3bb30000003f4cefceb300000000000000000000803f0000803f00000000000000000000803f + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0.000000044703484, y: 0, z: 0} + m_Extent: {x: 0.49999994, y: 0.5, z: 0.0000001718594} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: diff --git a/Runtime/Meshes/Triangle.asset.meta b/Runtime/Meshes/Triangle.asset.meta new file mode 100644 index 0000000..095701c --- /dev/null +++ b/Runtime/Meshes/Triangle.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef8fab5517c7e794482a0cabdd78a50d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4300000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Meshes/WireDotDiamond.asset b/Runtime/Meshes/WireDotDiamond.asset new file mode 100644 index 0000000..aabd4c9 --- /dev/null +++ b/Runtime/Meshes/WireDotDiamond.asset @@ -0,0 +1,167 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!43 &4300000 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WireDotDiamond + serializedVersion: 11 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 8 + topology: 3 + baseVertex: 0 + firstVertex: 0 + vertexCount: 4 + localAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 0} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: [] + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: [] + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 1 + m_KeepIndices: 1 + m_IndexFormat: 0 + m_IndexBuffer: 00000100010002000200030003000000 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 4 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + m_DataSize: 48 + _typelessdata: 000000000000003f00000000000000bf000000000000000000000000000000bf000000000000003f0000000000000000 + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 0} + m_MeshUsageFlags: 0 + m_CookingOptions: 30 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + 'm_MeshMetrics[0]': 1 + 'm_MeshMetrics[1]': 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: diff --git a/Runtime/Meshes/WireDotDiamond.asset.meta b/Runtime/Meshes/WireDotDiamond.asset.meta new file mode 100644 index 0000000..eaacb6b --- /dev/null +++ b/Runtime/Meshes/WireDotDiamond.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af15cfefc38cf3b438c37b40b827fbba +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4300000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Resources/DCFApixels.DebugX/MeshesList.prefab b/Runtime/Resources/DCFApixels.DebugX/MeshesList.prefab index 64f8c20..2da2f89 100644 --- a/Runtime/Resources/DCFApixels.DebugX/MeshesList.prefab +++ b/Runtime/Resources/DCFApixels.DebugX/MeshesList.prefab @@ -1,5 +1,114 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &346591584127795354 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2111990020664093690} + - component: {fileID: 1788772289853385339} + - component: {fileID: 9164957506466761196} + - component: {fileID: 5430506558126952110} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2111990020664093690 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 346591584127795354} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 857828809698174216} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1788772289853385339 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 346591584127795354} + m_Mesh: {fileID: 4300000, guid: 58c1d6dfb1981574595c1b1601525ab2, type: 2} +--- !u!23 &9164957506466761196 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 346591584127795354} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 493816cf77c003846870e9a319025383, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &5430506558126952110 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 346591584127795354} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 4300000, guid: 58c1d6dfb1981574595c1b1601525ab2, type: 2} --- !u!1 &506341672800905711 GameObject: m_ObjectHideFlags: 0 @@ -344,6 +453,178 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1343803445595405097 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3694843316245994810} + - component: {fileID: 2748556262898402053} + - component: {fileID: 5278077378328675129} + m_Layer: 0 + m_Name: WireDotDiamond + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3694843316245994810 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1343803445595405097} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -15, y: -5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 857828809698174216} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2748556262898402053 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1343803445595405097} + m_Mesh: {fileID: 4300000, guid: af15cfefc38cf3b438c37b40b827fbba, type: 2} +--- !u!23 &5278077378328675129 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1343803445595405097} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 493816cf77c003846870e9a319025383, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1715450950964063707 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3240469495737734278} + - component: {fileID: 958970125513210168} + - component: {fileID: 9139131881605765310} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3240469495737734278 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715450950964063707} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.5, y: 2.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 857828809698174216} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &958970125513210168 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715450950964063707} + m_Mesh: {fileID: 4300000, guid: e6ab4bd9eac93c345a4f02aa6e81b160, type: 2} +--- !u!23 &9139131881605765310 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715450950964063707} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 493816cf77c003846870e9a319025383, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!1 &2068056515493626881 GameObject: m_ObjectHideFlags: 0 @@ -543,7 +824,7 @@ Transform: m_GameObject: {fileID: 3249552717970432234} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -2.5, y: 2.5, z: 0} + m_LocalPosition: {x: 0, y: 5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -636,6 +917,9 @@ Transform: - {fileID: 2473096954649536056} - {fileID: 8730918078396147359} - {fileID: 4102080354430468402} + - {fileID: 3240469495737734278} + - {fileID: 2111990020664093690} + - {fileID: 2171646053211866925} - {fileID: 1671259188215746302} - {fileID: 2411152006734480509} - {fileID: 2824320444920839439} @@ -646,6 +930,7 @@ Transform: - {fileID: 6347759664918351118} - {fileID: 22482123004051014} - {fileID: 6416146816802520747} + - {fileID: 3694843316245994810} - {fileID: 7457780275450430367} - {fileID: 7350875072433995390} - {fileID: 5310707693280878108} @@ -1001,7 +1286,7 @@ Transform: m_GameObject: {fileID: 6233730693849974323} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 5, z: 0} + m_LocalPosition: {x: 2.5, y: 5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1435,6 +1720,92 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &8766027047866484941 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2171646053211866925} + - component: {fileID: 1949009084715085027} + - component: {fileID: 2968965231773459393} + m_Layer: 0 + m_Name: Triangle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2171646053211866925 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8766027047866484941} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 2.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 857828809698174216} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1949009084715085027 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8766027047866484941} + m_Mesh: {fileID: 4300000, guid: ef8fab5517c7e794482a0cabdd78a50d, type: 2} +--- !u!23 &2968965231773459393 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8766027047866484941} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 493816cf77c003846870e9a319025383, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!1 &8867296224961591244 GameObject: m_ObjectHideFlags: 0 diff --git a/Runtime/Utils/DebugXAssets.cs b/Runtime/Utils/DebugXAssets.cs index e550932..1a4d4ef 100644 --- a/Runtime/Utils/DebugXAssets.cs +++ b/Runtime/Utils/DebugXAssets.cs @@ -17,6 +17,9 @@ namespace DCFApixels.DebugXCore public readonly Mesh Quad; public readonly Mesh Circle; // Circle_1 public readonly Mesh Sphere; // Sphere_0 + public readonly Mesh Cylinder; + public readonly Mesh Cone; + public readonly Mesh Triangle; public readonly Mesh CapsuleBody; public readonly Mesh CapsuleHead; @@ -27,6 +30,7 @@ namespace DCFApixels.DebugXCore public readonly Mesh DotQuad; public readonly Mesh DotCross; public readonly Mesh DotDiamond; + public readonly Mesh WireDotDiamond; public readonly Mesh WireLine; public readonly Mesh WireCube; diff --git a/Runtime/Utils/StaticData.cs b/Runtime/Utils/StaticData.cs index 0f729a5..76cabc4 100644 --- a/Runtime/Utils/StaticData.cs +++ b/Runtime/Utils/StaticData.cs @@ -62,6 +62,18 @@ namespace DCFApixels.DebugXCore { public Mesh GetMesh() => DebugXAssets.Meshes.Circle; } + public readonly struct CylinderMesh : IStaticMesh + { + public Mesh GetMesh() => DebugXAssets.Meshes.Cylinder; + } + public readonly struct ConeMesh : IStaticMesh + { + public Mesh GetMesh() => DebugXAssets.Meshes.Cone; + } + public readonly struct TriangleMesh : IStaticMesh + { + public Mesh GetMesh() => DebugXAssets.Meshes.Triangle; + } public readonly struct CapsuleBodyMesh : IStaticMesh { public Mesh GetMesh() => DebugXAssets.Meshes.CapsuleBody; @@ -94,6 +106,10 @@ namespace DCFApixels.DebugXCore { public Mesh GetMesh() => DebugXAssets.Meshes.DotDiamond; } + public readonly struct WireDotDiamondMesh : IStaticMesh + { + public Mesh GetMesh() => DebugXAssets.Meshes.WireDotDiamond; + } public readonly struct DotCrossMesh : IStaticMesh { public Mesh GetMesh() => DebugXAssets.Meshes.DotCross; diff --git a/Samples/Sample.unity b/Samples/Sample.unity index 9766579..e489366 100644 --- a/Samples/Sample.unity +++ b/Samples/Sample.unity @@ -144,7 +144,7 @@ Transform: m_GameObject: {fileID: 34092089} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 1.5, y: 0, z: -1} + m_LocalPosition: {x: 1.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -206,7 +206,7 @@ Transform: m_GameObject: {fileID: 54381891} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -0.5, y: 0, z: 1} + m_LocalPosition: {x: -0.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -440,7 +440,7 @@ Transform: m_GameObject: {fileID: 72966245} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 0.5, y: 0, z: -1} + m_LocalPosition: {x: 0.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -622,7 +622,7 @@ MonoBehaviour: m_ColorSpace: -1 m_NumColorKeys: 3 m_NumAlphaKeys: 2 - GradientMultiplier: 1.7 + GradientMultiplier: 2 Points: - {fileID: 1728437382} - {fileID: 54381892} @@ -632,6 +632,10 @@ MonoBehaviour: - {fileID: 458625217} - {fileID: 1048642971} - {fileID: 34092090} + - {fileID: 1600881795} + - {fileID: 2047223214} + - {fileID: 1269882118} + - {fileID: 1302158463} --- !u!4 &141926652 Transform: m_ObjectHideFlags: 0 @@ -674,7 +678,7 @@ Transform: m_GameObject: {fileID: 151432311} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -0.5, y: 0, z: 1} + m_LocalPosition: {x: -0.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -717,6 +721,10 @@ Transform: - {fileID: 458625217} - {fileID: 1048642971} - {fileID: 34092090} + - {fileID: 1600881795} + - {fileID: 2047223214} + - {fileID: 1269882118} + - {fileID: 1302158463} m_Father: {fileID: 141926652} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &170909420 @@ -805,6 +813,68 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 170909420} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &190783942 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 190783943} + m_Layer: 0 + m_Name: Point (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &190783943 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 190783942} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 1.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2137543453} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} +--- !u!1 &214201429 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 214201430} + m_Layer: 0 + m_Name: Point (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &214201430 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 214201429} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: -0.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2137543453} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &227658960 GameObject: m_ObjectHideFlags: 0 @@ -1425,7 +1495,7 @@ Transform: m_GameObject: {fileID: 317268507} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 0.5, y: 0, z: 1} + m_LocalPosition: {x: 0.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1456,7 +1526,38 @@ Transform: m_GameObject: {fileID: 322696744} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -1.5, y: 0, z: -1} + m_LocalPosition: {x: -1.5, y: 0, z: 0} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2137543453} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} +--- !u!1 &336585571 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 336585572} + m_Layer: 0 + m_Name: Point (8) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &336585572 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 336585571} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: -1.5, y: 0, z: -1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1598,6 +1699,11 @@ Transform: - {fileID: 807642932} - {fileID: 767010255} - {fileID: 859593072} + - {fileID: 489310582} + - {fileID: 1456334050} + - {fileID: 1754071551} + - {fileID: 1349340033} + - {fileID: 1592966087} m_Father: {fileID: 1144727111} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &360255115 @@ -1754,12 +1860,43 @@ Transform: m_GameObject: {fileID: 458625216} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -0.5, y: 0, z: -1} + m_LocalPosition: {x: -0.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 162132448} m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} +--- !u!1 &489310581 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 489310582} + m_Layer: 0 + m_Name: Point (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &489310582 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 489310581} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: -2, y: 0, z: -2} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 346532958} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &509436703 GameObject: m_ObjectHideFlags: 0 @@ -1785,7 +1922,7 @@ Transform: m_GameObject: {fileID: 509436703} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 1.5, y: 0, z: 1} + m_LocalPosition: {x: 1.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -2050,7 +2187,7 @@ Transform: m_GameObject: {fileID: 616384128} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 1.5, y: 0, z: -1} + m_LocalPosition: {x: 1.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -2299,7 +2436,7 @@ Transform: m_GameObject: {fileID: 675678363} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 0.5, y: 0, z: 1} + m_LocalPosition: {x: 0.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -2824,7 +2961,7 @@ Transform: m_GameObject: {fileID: 787914841} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -0.5, y: 0, z: -1} + m_LocalPosition: {x: -0.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -3121,7 +3258,7 @@ Transform: m_GameObject: {fileID: 1048642970} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 0.5, y: 0, z: -1} + m_LocalPosition: {x: 0.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -3336,6 +3473,11 @@ MonoBehaviour: - {fileID: 807642932} - {fileID: 767010255} - {fileID: 859593072} + - {fileID: 489310582} + - {fileID: 1456334050} + - {fileID: 1754071551} + - {fileID: 1349340033} + - {fileID: 1592966087} --- !u!4 &1144727111 Transform: m_ObjectHideFlags: 0 @@ -3378,7 +3520,7 @@ Transform: m_GameObject: {fileID: 1170244041} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -1.5, y: 0, z: 1} + m_LocalPosition: {x: -1.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -3477,6 +3619,68 @@ Transform: m_Children: [] m_Father: {fileID: 241950277} m_LocalEulerAnglesHint: {x: 0, y: -195, z: -15} +--- !u!1 &1269882117 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1269882118} + m_Layer: 0 + m_Name: Point (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1269882118 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1269882117} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 0.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 162132448} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} +--- !u!1 &1302158462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1302158463} + m_Layer: 0 + m_Name: Point (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1302158463 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302158462} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 1.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 162132448} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1325554304 GameObject: m_ObjectHideFlags: 0 @@ -3594,6 +3798,37 @@ Transform: m_Children: [] m_Father: {fileID: 1625911623} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1349340032 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1349340033} + m_Layer: 0 + m_Name: Point (12) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1349340033 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349340032} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 1, y: 0, z: -2} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 346532958} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1371953102 GameObject: m_ObjectHideFlags: 0 @@ -3859,6 +4094,37 @@ Transform: m_Children: [] m_Father: {fileID: 1625911623} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1456334049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1456334050} + m_Layer: 0 + m_Name: Point (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1456334050 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1456334049} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: -1, y: 0, z: -2} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 346532958} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1482731615 GameObject: m_ObjectHideFlags: 0 @@ -4087,7 +4353,7 @@ Transform: m_GameObject: {fileID: 1563901308} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -1.5, y: 0, z: -1} + m_LocalPosition: {x: -1.5, y: 0, z: 0} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -4118,12 +4384,43 @@ Transform: m_GameObject: {fileID: 1576807305} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: 1.5, y: 0, z: 1} + m_LocalPosition: {x: 1.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2137543453} m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} +--- !u!1 &1592966086 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1592966087} + m_Layer: 0 + m_Name: Point (13) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1592966087 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1592966086} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 2, y: 0, z: -2} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 346532958} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1596824982 GameObject: m_ObjectHideFlags: 0 @@ -4155,6 +4452,37 @@ Transform: m_Children: [] m_Father: {fileID: 1625911623} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1600881794 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1600881795} + m_Layer: 0 + m_Name: Point (8) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1600881795 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1600881794} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: -1.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 162132448} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1604855721 GameObject: m_ObjectHideFlags: 0 @@ -4269,6 +4597,37 @@ Transform: m_Children: [] m_Father: {fileID: 234433271} m_LocalEulerAnglesHint: {x: 0, y: 30, z: -15} +--- !u!1 &1724596785 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724596786} + m_Layer: 0 + m_Name: Point (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1724596786 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724596785} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 0.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2137543453} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1728437381 GameObject: m_ObjectHideFlags: 0 @@ -4294,7 +4653,7 @@ Transform: m_GameObject: {fileID: 1728437381} serializedVersion: 2 m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} - m_LocalPosition: {x: -1.5, y: 0, z: 1} + m_LocalPosition: {x: -1.5, y: 0, z: 1.75} m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] @@ -4558,6 +4917,37 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1741031242} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1754071550 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1754071551} + m_Layer: 0 + m_Name: Point (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1754071551 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1754071550} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: 0, y: 0, z: -2} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 346532958} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &1770294770 GameObject: m_ObjectHideFlags: 0 @@ -4785,7 +5175,7 @@ MonoBehaviour: m_ColorSpace: -1 m_NumColorKeys: 3 m_NumAlphaKeys: 2 - GradientMultiplier: 1.7 + GradientMultiplier: 2 Points: - {fileID: 1170244042} - {fileID: 151432312} @@ -4795,6 +5185,10 @@ MonoBehaviour: - {fileID: 787914842} - {fileID: 72966246} - {fileID: 616384129} + - {fileID: 336585572} + - {fileID: 214201430} + - {fileID: 1724596786} + - {fileID: 190783943} --- !u!4 &2024424932 Transform: m_ObjectHideFlags: 0 @@ -4898,6 +5292,37 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2036095643} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2047223213 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2047223214} + m_Layer: 0 + m_Name: Point (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2047223214 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2047223213} + serializedVersion: 2 + m_LocalRotation: {x: 0.38268343, y: 0, z: 0, w: 0.92387956} + m_LocalPosition: {x: -0.5, y: 0, z: -1.75} + m_LocalScale: {x: 0.75, y: 1.25, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 162132448} + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} --- !u!1 &2070085915 GameObject: m_ObjectHideFlags: 0 @@ -5110,6 +5535,10 @@ Transform: - {fileID: 787914842} - {fileID: 72966246} - {fileID: 616384129} + - {fileID: 336585572} + - {fileID: 214201430} + - {fileID: 1724596786} + - {fileID: 190783943} m_Father: {fileID: 2024424932} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1660057539 &9223372036854775807 diff --git a/Samples/Scripts/DebugXSample_Other.cs b/Samples/Scripts/DebugXSample_Other.cs index 7f59369..437bca1 100644 --- a/Samples/Scripts/DebugXSample_Other.cs +++ b/Samples/Scripts/DebugXSample_Other.cs @@ -34,7 +34,10 @@ namespace DCFApixels.DebugXCore.Samples i++; DebugX.Draw(GetColor(Points[i])).Dot(Points[i].position); i++; DebugX.Draw(GetColor(Points[i])).WireDot(Points[i].position); i++; DebugX.Draw(GetColor(Points[i])).DotQuad(Points[i].position); + i++; DebugX.Draw(GetColor(Points[i])).WireDotQuad(Points[i].position); i++; DebugX.Draw(GetColor(Points[i])).DotDiamond(Points[i].position); + i++; DebugX.Draw(GetColor(Points[i])).WireDotDiamond(Points[i].position); + i++; DebugX.Draw(GetColor(Points[i])).DotCross(Points[i].position); } private Color GetColor(Transform pos1) diff --git a/Samples/Scripts/DebugXSample_Primitives2D.cs b/Samples/Scripts/DebugXSample_Primitives2D.cs index 39c2c72..5afc3cb 100644 --- a/Samples/Scripts/DebugXSample_Primitives2D.cs +++ b/Samples/Scripts/DebugXSample_Primitives2D.cs @@ -31,6 +31,11 @@ namespace DCFApixels.DebugXCore.Samples i++; DebugX.Draw(GetColor(Points[i])).QuadGrid(Points[i].position, Points[i].rotation, Points[i].localScale, Vector2Int.one * 3); i++; DebugX.Draw(GetColor(Points[i])).QuadPoints(Points[i].position, Points[i].rotation, Points[i].localScale); + i++; + i++; DebugX.Draw(GetColor(Points[i])).Triangle(Points[i].position, Points[i].rotation, Points[i].localScale); + i++; DebugX.Draw(GetColor(Points[i])).WireTriangle(Points[i].position, Points[i].rotation, Points[i].localScale); + i++; + i++; DebugX.Draw(GetColor(Points[i])).Circle(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M); i++; DebugX.Draw(GetColor(Points[i])).WireCircle(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M); i++; DebugX.Draw(GetColor(Points[i])).FlatCapsule(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M, Points[i].localScale.y); diff --git a/Samples/Scripts/DebugXSample_Primitives3D.cs b/Samples/Scripts/DebugXSample_Primitives3D.cs index af53a69..8e072f2 100644 --- a/Samples/Scripts/DebugXSample_Primitives3D.cs +++ b/Samples/Scripts/DebugXSample_Primitives3D.cs @@ -32,6 +32,11 @@ namespace DCFApixels.DebugXCore.Samples i++; DebugX.Draw(GetColor(Points[i])).CubeGrid(Points[i].position, Points[i].rotation, Points[i].localScale, Vector3Int.one * 3); i++; DebugX.Draw(GetColor(Points[i])).CubePoints(Points[i].position, Points[i].rotation, Points[i].localScale); + i++; DebugX.Draw(GetColor(Points[i])).Cylinder(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M, Points[i].localScale.y); + i++; DebugX.Draw(GetColor(Points[i])).WireCylinder(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M, Points[i].localScale.y); + i++; DebugX.Draw(GetColor(Points[i])).Cone(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M, Points[i].localScale.y); + i++; DebugX.Draw(GetColor(Points[i])).WireCone(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M, Points[i].localScale.y); + i++; DebugX.Draw(GetColor(Points[i])).Sphere(Points[i].position, Points[i].localScale.x * RADIUS_M); i++; DebugX.Draw(GetColor(Points[i])).WireSphere(Points[i].position, Points[i].localScale.x * RADIUS_M); i++; DebugX.Draw(GetColor(Points[i])).Capsule(Points[i].position, Points[i].rotation, Points[i].localScale.x * RADIUS_M, Points[i].localScale.y); From a4269ac7f57aa12d8db0586daade363cf624f453 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 27 Feb 2025 21:19:54 +0800 Subject: [PATCH 03/14] fix text render --- Runtime/DebugX.cs | 2 +- Runtime/Gizmos/DebugX.text.cs | 128 +++++++++++++++------------------- 2 files changed, 56 insertions(+), 74 deletions(-) diff --git a/Runtime/DebugX.cs b/Runtime/DebugX.cs index 4147200..215f83f 100644 --- a/Runtime/DebugX.cs +++ b/Runtime/DebugX.cs @@ -346,8 +346,8 @@ namespace DCFApixels Color gizmosColor = Gizmos.color; #if Handles Color handlesColor = Handles.color; -#endif GL.MultMatrix(Handles.matrix); +#endif RenderContextController.StaicContextController.Render_UnityGizmos(); diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 784402f..69d5e5f 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -37,28 +37,30 @@ namespace DCFApixels public IGizmoRenderer RegisterNewRenderer() { return new Renderer(); } #region Renderer - private class Renderer : IGizmoRenderer_UnityGizmos + private class Renderer : IGizmoRenderer { private static GUIStyle _labelStyle; private static GUIContent _labelDummy; + private static Texture2D _whiteTexture; public int ExecuteOrder => default(UnlitMat).GetExecuteOrder(); public bool IsStaticRender => false; public void Prepare(Camera camera, GizmosList list) { } - public void Render(Camera camera, GizmosList list, CommandBuffer cb) { } + public void Render(Camera camera, GizmosList list, CommandBuffer cb) + { + Render_UnityGizmos(camera, list); + } public void Render_UnityGizmos(Camera camera, GizmosList list) { -#if UNITY_EDITOR + //return; +//#if UNITY_EDITOR if (Event.current.type != EventType.Repaint) { return; } - //bool c = camera.name == "SceneCamera"; - bool ccc = camera == Camera.main; - //bool x = camera == Camera.main; - bool x = true; + Color dfColor = GUI.color; if (camera == null) { return; } InitStatic(); var zoom = GetCameraZoom(camera); - Handles.BeginGUI(); + //Handles.BeginGUI(); foreach (ref readonly var item in list) { _labelDummy.text = item.Value.Text; @@ -88,9 +90,9 @@ namespace DCFApixels Color c = item.Value.Settings.BackgroundColor * GlobalColor; GUI.color = c; - GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture); + //GUI.DrawTexture(rect, _whiteTexture); - //Graphics.DrawTexture(screenRect, EditorGUIUtility.whiteTexture, screenRect, 0, 0, 0, 0); + //Graphics.DrawTexture(rect, EditorGUIUtility.whiteTexture); //Graphics.DrawTexture(screenRect, EditorGUIUtility.whiteTexture, screenRect, 0, 0, 0, 0); GUI.color = item.Color * GlobalColor; @@ -99,8 +101,9 @@ namespace DCFApixels GL.PopMatrix(); } } - Handles.EndGUI(); -#endif + //Handles.EndGUI(); + GUI.color = dfColor; +//#endif } @@ -109,15 +112,17 @@ namespace DCFApixels { #if UNITY_EDITOR world = Handles.matrix.MultiplyPoint(world); +#endif Vector3 vector = camera.WorldToScreenPoint(world); vector.y = camera.pixelHeight - vector.y; - Vector2 vector2 = EditorGUIUtility.PixelsToPoints(vector); - return new Vector3(vector2.x, vector2.y, vector.z); + Vector2 vector2 = (Vector2)(vector); +#if UNITY_EDITOR + vector2 = EditorGUIUtility.PixelsToPoints(vector); #endif + return new Vector3(vector2.x, vector2.y, vector.z); } public static Rect WorldPointToSizedRect(Camera camera, Vector3 position, GUIContent content, GUIStyle style) { -#if UNITY_EDITOR Vector2 vector = (Vector2)WorldToGUIPointWithDepth(camera, position); Vector2 vector2 = style.CalcSize(content); Rect rect = new Rect(vector.x, vector.y, vector2.x, vector2.y); @@ -154,75 +159,52 @@ namespace DCFApixels } return style.padding.Add(rect); -#endif - } - //internal static bool CalculateScaledTextureRects(Rect position, ScaleMode scaleMode, float imageAspect, ref Rect outScreenRect, ref Rect outSourceRect) - internal static bool CalculateScaledTextureRects(Rect position, ScaleMode scaleMode, ref Rect outScreenRect, ref Rect outSourceRect) - { - const float imageAspect = 1; - - - float num = position.width / position.height; - bool result = false; - switch (scaleMode) - { - case ScaleMode.StretchToFill: - outScreenRect = position; - outSourceRect = new Rect(0f, 0f, 1f, 1f); - result = true; - break; - case ScaleMode.ScaleAndCrop: - if (num > imageAspect) - { - float num4 = imageAspect / num; - outScreenRect = position; - outSourceRect = new Rect(0f, (1f - num4) * 0.5f, 1f, num4); - result = true; - } - else - { - float num5 = num / imageAspect; - outScreenRect = position; - outSourceRect = new Rect(0.5f - num5 * 0.5f, 0f, num5, 1f); - result = true; - } - - break; - case ScaleMode.ScaleToFit: - if (num > imageAspect) - { - float num2 = imageAspect / num; - outScreenRect = new Rect(position.xMin + position.width * (1f - num2) * 0.5f, position.yMin, num2 * position.width, position.height); - outSourceRect = new Rect(0f, 0f, 1f, 1f); - result = true; - } - else - { - float num3 = num / imageAspect; - outScreenRect = new Rect(position.xMin, position.yMin + position.height * (1f - num3) * 0.5f, position.width, num3 * position.height); - outSourceRect = new Rect(0f, 0f, 1f, 1f); - result = true; - } - - break; - } - - return result; } #endregion private void InitStatic() { - if (_labelStyle == null || _labelDummy == null) + if (_labelStyle == null || _labelDummy == null || _whiteTexture == null) { - _labelStyle = new GUIStyle(GUI.skin.label) + + GUIStyleState GenerateGUIStyleState() + { + var result = new GUIStyleState(); + result.textColor = Color.white; + result.background = null; + return result; + } + + GUISkin skin = (GUISkin)typeof(GUI).GetField("s_Skin", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null); //GUI.s_Skin + //GUISkin skin = GUI.skin; + _labelStyle = new GUIStyle(skin.label) { richText = false, - padding = new RectOffset(0, 0, 0, 0), - margin = new RectOffset(0, 0, 0, 0) + padding = new RectOffset(0, 0, 3, 3), + margin = new RectOffset(4, 4, 4, 4), + normal = GenerateGUIStyleState(), + active = GenerateGUIStyleState(), + hover = GenerateGUIStyleState(), + focused = GenerateGUIStyleState(), }; + + _labelDummy = new GUIContent(); + + + _whiteTexture = new Texture2D(2, 2); + Color32[] color = new Color32[] + { + new Color32(255,255,255,255), + new Color32(255,255,255,255), + new Color32(255,255,255,255), + new Color32(255,255,255,255), + }; + for (int i = 0; i < 4; i++) + { + _whiteTexture.SetPixels32(color); + } } } private static float GetCameraZoom(Camera camera) From c267b9401c445351050097190020095f2458a729 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:16:14 +0800 Subject: [PATCH 04/14] fix text background --- Runtime/Gizmos/DebugX.text.cs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 69d5e5f..8a8266f 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -51,8 +51,6 @@ namespace DCFApixels } public void Render_UnityGizmos(Camera camera, GizmosList list) { - //return; -//#if UNITY_EDITOR if (Event.current.type != EventType.Repaint) { return; } Color dfColor = GUI.color; @@ -92,7 +90,9 @@ namespace DCFApixels GUI.color = c; //GUI.DrawTexture(rect, _whiteTexture); - //Graphics.DrawTexture(rect, EditorGUIUtility.whiteTexture); + var mat = DebugXAssets.Materials.Unlit; + mat.SetColor(ColorPropertyID, c); + Graphics.DrawTexture(rect, _whiteTexture, mat); //Graphics.DrawTexture(screenRect, EditorGUIUtility.whiteTexture, screenRect, 0, 0, 0, 0); GUI.color = item.Color * GlobalColor; @@ -101,9 +101,8 @@ namespace DCFApixels GL.PopMatrix(); } } - //Handles.EndGUI(); GUI.color = dfColor; -//#endif + DebugXAssets.Materials.Unlit.SetColor(ColorPropertyID, Color.white); } @@ -157,7 +156,6 @@ namespace DCFApixels rect.y -= rect.height; break; } - return style.padding.Add(rect); } #endregion @@ -167,7 +165,6 @@ namespace DCFApixels { if (_labelStyle == null || _labelDummy == null || _whiteTexture == null) { - GUIStyleState GenerateGUIStyleState() { var result = new GUIStyleState(); @@ -175,24 +172,21 @@ namespace DCFApixels result.background = null; return result; } - GUISkin skin = (GUISkin)typeof(GUI).GetField("s_Skin", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null); //GUI.s_Skin //GUISkin skin = GUI.skin; _labelStyle = new GUIStyle(skin.label) { richText = false, - padding = new RectOffset(0, 0, 3, 3), - margin = new RectOffset(4, 4, 4, 4), + padding = new RectOffset(1, 1, 1, 1), + margin = new RectOffset(0, 0, 0, 0), normal = GenerateGUIStyleState(), active = GenerateGUIStyleState(), hover = GenerateGUIStyleState(), focused = GenerateGUIStyleState(), }; - _labelDummy = new GUIContent(); - _whiteTexture = new Texture2D(2, 2); Color32[] color = new Color32[] { @@ -201,10 +195,8 @@ namespace DCFApixels new Color32(255,255,255,255), new Color32(255,255,255,255), }; - for (int i = 0; i < 4; i++) - { - _whiteTexture.SetPixels32(color); - } + _whiteTexture.SetPixels32(color); + _whiteTexture.Apply(); } } private static float GetCameraZoom(Camera camera) From 1aa6c967973712141d2e0bedc2df70b0b41f8096 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:24:37 +0800 Subject: [PATCH 05/14] fix text offset --- Runtime/Gizmos/DebugX.text.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 8a8266f..3669ffe 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -57,7 +57,7 @@ namespace DCFApixels if (camera == null) { return; } InitStatic(); var zoom = GetCameraZoom(camera); - + var isSceneView = camera.name == "SceneCamera"; //Handles.BeginGUI(); foreach (ref readonly var item in list) { @@ -72,32 +72,21 @@ namespace DCFApixels if (!(WorldToGUIPointWithDepth(camera, item.Value.Position).z < 0f)) { Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle); - //if (x) Debug.Log(rect); - - - ////GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture); - //Rect screenRect = default; - //Rect originRect = default; - //CalculateScaledTextureRects(rect, ScaleMode.StretchToFill, ref screenRect, ref originRect); - GL.PushMatrix(); - GL.LoadPixelMatrix(0, Screen.width, Screen.height, 0); + GL.LoadPixelMatrix(0, Screen.width, Screen.height - (isSceneView ? 50 : 0), 0); - //Graphics.DrawTexture(screenRect, EditorGUIUtility.whiteTexture, screenRect, 0, 0, 0, 0); Color c = item.Value.Settings.BackgroundColor * GlobalColor; GUI.color = c; - //GUI.DrawTexture(rect, _whiteTexture); - var mat = DebugXAssets.Materials.Unlit; mat.SetColor(ColorPropertyID, c); Graphics.DrawTexture(rect, _whiteTexture, mat); - //Graphics.DrawTexture(screenRect, EditorGUIUtility.whiteTexture, screenRect, 0, 0, 0, 0); GUI.color = item.Color * GlobalColor; style.Draw(rect, _labelDummy, false, false, false, false); + GL.PopMatrix(); } } From 6eb6e61d02f9d0f12277e7beeced908f1d313e38 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:24:44 +0800 Subject: [PATCH 06/14] update sample --- Samples/Other/Ground.mat | 4 ++-- Samples/Sample.unity | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Samples/Other/Ground.mat b/Samples/Other/Ground.mat index a397a41..1f5774b 100644 --- a/Samples/Other/Ground.mat +++ b/Samples/Other/Ground.mat @@ -135,14 +135,14 @@ Material: - _GlossinessSource: 0 - _GlossyReflections: 1 - _LightingEnabled: 1 - - _Metallic: 0 + - _Metallic: 0.046 - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - _QueueOffset: 0 - _ReceiveShadows: 0 - _Shininess: 0 - - _Smoothness: 0 + - _Smoothness: 0.047 - _SmoothnessSource: 0 - _SmoothnessTextureChannel: 0 - _SoftParticlesEnabled: 0 diff --git a/Samples/Sample.unity b/Samples/Sample.unity index 3bfdc5a..dd247d0 100644 --- a/Samples/Sample.unity +++ b/Samples/Sample.unity @@ -1229,7 +1229,7 @@ Camera: m_ShutterSpeed: 0.005 m_Aperture: 16 m_FocusDistance: 10 - m_FocalLength: 50 + m_FocalLength: 20.78461 m_BladeCount: 5 m_Curvature: {x: 2, y: 11} m_BarrelClipping: 0.25 @@ -1244,7 +1244,7 @@ Camera: height: 1 near clip plane: 0.3 far clip plane: 1000 - field of view: 60 + field of view: 60.000004 orthographic: 0 orthographic size: 5 m_Depth: -1 @@ -1277,7 +1277,7 @@ Transform: m_Children: - {fileID: 1800693605} m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &298618463 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4135,9 +4135,9 @@ GameObject: m_Component: - component: {fileID: 1482731616} m_Layer: 0 - m_Name: Hello World Hello World Hello World + m_Name: Hello World m_TagString: Untagged - m_Icon: {fileID: 0} + m_Icon: {fileID: 7866945982896999795, guid: 0000000000000000d000000000000000, type: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 From c91c27c1cbc71b9ff114b705b37219724162e4ad Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:28:47 +0800 Subject: [PATCH 07/14] fix text --- Runtime/Gizmos/DebugX.text.cs | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 3669ffe..d74257b 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -57,8 +57,23 @@ namespace DCFApixels if (camera == null) { return; } InitStatic(); var zoom = GetCameraZoom(camera); - var isSceneView = camera.name == "SceneCamera"; - //Handles.BeginGUI(); + bool isSceneView = false; +#if UNITY_EDITOR + isSceneView = camera.name == "SceneCamera"; +#endif + + if (isSceneView) + { +#if UNITY_EDITOR + Handles.BeginGUI(); +#endif + } + else + { + GL.PushMatrix(); + //GL.LoadPixelMatrix(0, Screen.width, Screen.height - (isSceneView ? 50 : 0), 0); + GL.LoadPixelMatrix(0, Screen.width, Screen.height, 0); + } foreach (ref readonly var item in list) { _labelDummy.text = item.Value.Text; @@ -73,8 +88,7 @@ namespace DCFApixels { Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle); - GL.PushMatrix(); - GL.LoadPixelMatrix(0, Screen.width, Screen.height - (isSceneView ? 50 : 0), 0); + Color c = item.Value.Settings.BackgroundColor * GlobalColor; @@ -87,11 +101,21 @@ namespace DCFApixels style.Draw(rect, _labelDummy, false, false, false, false); - GL.PopMatrix(); } } GUI.color = dfColor; DebugXAssets.Materials.Unlit.SetColor(ColorPropertyID, Color.white); + + if (isSceneView) + { +#if UNITY_EDITOR + Handles.EndGUI(); +#endif + } + else + { + GL.PopMatrix(); + } } From 94bf266d1824659dcf83668e0c67fcfc8cee9850 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:47:18 +0800 Subject: [PATCH 08/14] fix text render sorting --- Runtime/DebugX.cs | 71 +++++----------------- Runtime/Gizmos/DebugX.text.cs | 15 +---- Runtime/Internal/CommandBufferExecutors.cs | 6 ++ Runtime/Utils/IGizmo.cs | 4 +- 4 files changed, 25 insertions(+), 71 deletions(-) diff --git a/Runtime/DebugX.cs b/Runtime/DebugX.cs index 215f83f..2a2c6e4 100644 --- a/Runtime/DebugX.cs +++ b/Runtime/DebugX.cs @@ -307,8 +307,9 @@ namespace DCFApixels { RenderContextController.StaicContextController.Prepare(); RenderContextController.StaicContextController.Render(cbExecutor); - - CallDrawGizmos(camera); + cbExecutor.Submit(); + RenderContextController.StaicContextController.PostRender(); + RenderContextController.StaicContextController.RunEnd(); } if (camera == null) { return; } @@ -316,54 +317,10 @@ namespace DCFApixels RenderContextController contextController = RenderContextController.GetController(new RenderContext(camera)); contextController.Prepare(); contextController.Render(cbExecutor); - + cbExecutor.Submit(); + contextController.PostRender(); + contextController.RunEnd(); } - -#if UNITY_EDITOR - - [DrawGizmo(GizmoType.NonSelected | GizmoType.Selected)] - private static void DrawGizmos(Camera obj, GizmoType gizmoType) - { - if (obj != Camera.main) { return; } - - //if (_lastEditorToRenderGizmosTicks != _editorTicks) - //{ - // _renderGizmosTicks++; - // _lastEditorToRenderGizmosTicks = _editorTicks; - //} - - //Camera camera = Camera.current; - //CallDrawGizmos(camera); - } -#endif - - private static void CallDrawGizmos(Camera camera) - { - - Color guiColor = GUI.color; - Color guiContextColor = GUI.contentColor; - Color guiBackgroundColor = GUI.backgroundColor; - Color gizmosColor = Gizmos.color; -#if Handles - Color handlesColor = Handles.color; - GL.MultMatrix(Handles.matrix); -#endif - - RenderContextController.StaicContextController.Render_UnityGizmos(); - - if (camera == null) { return; } - _currentCamera = camera; - RenderContextController.GetController(new RenderContext(camera)).Render_UnityGizmos(); - - GUI.color = guiColor; - GUI.contentColor = guiContextColor; - GUI.backgroundColor = guiBackgroundColor; - Gizmos.color = gizmosColor; -#if Handles - Handles.color = handlesColor; -#endif - } - #endregion @@ -586,13 +543,13 @@ namespace DCFApixels _buffers[i].Render(cbExecutor); } - RunEnd(); + //RunEnd(); } } [IN(LINE)] - public void Render_UnityGizmos() + public void PostRender() { #if UNITY_EDITOR using (_cameraMarker.Auto()) @@ -600,7 +557,7 @@ namespace DCFApixels { for (int i = 0, iMax = _buffers.Count; i < iMax; i++) { - _buffers[i].Render_UnityGizmos(); + _buffers[i].PostRender(); } //RunEnd(); @@ -631,7 +588,7 @@ namespace DCFApixels public abstract int UpdateTimer(float deltaTime); public abstract void Prepare(); public abstract void Render(ICommandBufferExecutor cbExecutor); - public abstract void Render_UnityGizmos(); + public abstract void PostRender(); public abstract int RunEnd(); public abstract void Clear(); } @@ -654,7 +611,7 @@ namespace DCFApixels //private readonly CommandBuffer _dynamicCommandBuffer; private readonly IGizmoRenderer _renderer; - private readonly IGizmoRenderer_UnityGizmos _rendererUnityGizmos; + private readonly IGizmoRenderer_PostRender _rendererUnityGizmos; private readonly bool _isStatic; #if DEV_MODE @@ -681,7 +638,7 @@ namespace DCFApixels _renderer = new DummyRenderer(); } _isStatic = _renderer.IsStaticRender; - _rendererUnityGizmos = _renderer as IGizmoRenderer_UnityGizmos; + _rendererUnityGizmos = _renderer as IGizmoRenderer_PostRender; All.Add(this); All.Sort((a, b) => a.ExecuteOrder - b.ExecuteOrder); @@ -800,7 +757,7 @@ namespace DCFApixels cbExecutor.Execute(_staticCommandBuffer); } } - public override void Render_UnityGizmos() + public override void PostRender() { if (_rendererUnityGizmos == null) { return; } //Debug.Log(_gizmos._count); @@ -812,7 +769,7 @@ namespace DCFApixels GizmosList list = GizmosList.From(_gizmos._items, _gizmos._count); try { - _rendererUnityGizmos.Render_UnityGizmos(GetCurrentCamera(), list); + _rendererUnityGizmos.PostRender(GetCurrentCamera(), list); } catch (Exception e) { throw new Exception($"[{_debugName}] [Render] ", e); } } diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index d74257b..22aade5 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -37,7 +37,7 @@ namespace DCFApixels public IGizmoRenderer RegisterNewRenderer() { return new Renderer(); } #region Renderer - private class Renderer : IGizmoRenderer + private class Renderer : IGizmoRenderer_PostRender { private static GUIStyle _labelStyle; private static GUIContent _labelDummy; @@ -45,11 +45,8 @@ namespace DCFApixels public int ExecuteOrder => default(UnlitMat).GetExecuteOrder(); public bool IsStaticRender => false; public void Prepare(Camera camera, GizmosList list) { } - public void Render(Camera camera, GizmosList list, CommandBuffer cb) - { - Render_UnityGizmos(camera, list); - } - public void Render_UnityGizmos(Camera camera, GizmosList list) + public void Render(Camera camera, GizmosList list, CommandBuffer cb) { } + public void PostRender(Camera camera, GizmosList list) { if (Event.current.type != EventType.Repaint) { return; } Color dfColor = GUI.color; @@ -88,19 +85,13 @@ namespace DCFApixels { Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle); - - - Color c = item.Value.Settings.BackgroundColor * GlobalColor; - GUI.color = c; var mat = DebugXAssets.Materials.Unlit; mat.SetColor(ColorPropertyID, c); Graphics.DrawTexture(rect, _whiteTexture, mat); GUI.color = item.Color * GlobalColor; style.Draw(rect, _labelDummy, false, false, false, false); - - } } GUI.color = dfColor; diff --git a/Runtime/Internal/CommandBufferExecutors.cs b/Runtime/Internal/CommandBufferExecutors.cs index af78f59..506d42f 100644 --- a/Runtime/Internal/CommandBufferExecutors.cs +++ b/Runtime/Internal/CommandBufferExecutors.cs @@ -7,6 +7,7 @@ namespace DCFApixels.DebugXCore.Internal internal interface ICommandBufferExecutor { void Execute(CommandBuffer cb); + void Submit(); } internal class CommandBufferExecutorSRP : ICommandBufferExecutor { @@ -24,6 +25,10 @@ namespace DCFApixels.DebugXCore.Internal { RenderContext.ExecuteCommandBuffer(cb); } + public void Submit() + { + RenderContext.Submit(); + } } internal class CommandBufferExecutorBRP : ICommandBufferExecutor { @@ -39,5 +44,6 @@ namespace DCFApixels.DebugXCore.Internal { Graphics.ExecuteCommandBuffer(cb); } + public void Submit() { } } } \ No newline at end of file diff --git a/Runtime/Utils/IGizmo.cs b/Runtime/Utils/IGizmo.cs index e1073c0..e692740 100644 --- a/Runtime/Utils/IGizmo.cs +++ b/Runtime/Utils/IGizmo.cs @@ -17,9 +17,9 @@ namespace DCFApixels.DebugXCore void Prepare(Camera camera, GizmosList list); void Render(Camera camera, GizmosList list, CommandBuffer cb); } - public interface IGizmoRenderer_UnityGizmos : IGizmoRenderer where T : IGizmo + public interface IGizmoRenderer_PostRender : IGizmoRenderer where T : IGizmo { - void Render_UnityGizmos(Camera camera, GizmosList list); + void PostRender(Camera camera, GizmosList list); } From 5da2eb16eec593dbf04573240a04ced5ad2c9901 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 10:19:44 +0800 Subject: [PATCH 09/14] polishing --- Runtime/Consts.cs | 2 +- Runtime/DebugX.cs | 23 +++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Runtime/Consts.cs b/Runtime/Consts.cs index 1833f87..9cf27c9 100644 --- a/Runtime/Consts.cs +++ b/Runtime/Consts.cs @@ -29,7 +29,7 @@ namespace DCFApixels - private enum PauseStateX + private enum DebugXPauseState { Unpaused = 0, PreUnpaused = 1, //нужно чтобы отщелкунть паузу с задержкой в один тик diff --git a/Runtime/DebugX.cs b/Runtime/DebugX.cs index 2a2c6e4..02e3d3e 100644 --- a/Runtime/DebugX.cs +++ b/Runtime/DebugX.cs @@ -22,7 +22,7 @@ namespace DCFApixels using IN = System.Runtime.CompilerServices.MethodImplAttribute; public static unsafe partial class DebugX { - private static PauseStateX _pauseState = PauseStateX.Unpaused; + private static DebugXPauseState _pauseState = DebugXPauseState.Unpaused; private static bool _isCameraContext = false; private static double _lastUnityTime; @@ -31,18 +31,12 @@ namespace DCFApixels private static ulong _editorTicks = 0; private static ulong _lastEditorToRenderTicks = 1000; private static ulong _renderTicks = 100; - //private static ulong _lastEditorToRenderGizmosTicks = 1000; - //private static ulong _renderGizmosTicks = 100; private static ulong _timeTicks = 0; public static ulong RenderTicks { get { return _renderTicks; } } - //public static ulong RenderGizmosTicks - //{ - // get { return _renderGizmosTicks; } - //} public static ulong TimeTicks { get { return _timeTicks; } @@ -65,7 +59,7 @@ namespace DCFApixels #if UNITY_EDITOR private static void EditorApplication_pauseStateChanged(PauseState obj) { - _pauseState = obj == PauseState.Paused ? PauseStateX.Paused : PauseStateX.PreUnpaused; + _pauseState = obj == PauseState.Paused ? DebugXPauseState.Paused : DebugXPauseState.PreUnpaused; } #endif #endregion @@ -234,12 +228,10 @@ namespace DCFApixels private static void OnPreRender_BRP(Camera camera) { PreRender_General(camera); - //throw new NotImplementedException(); } private static void OnPostRender_BRP(Camera camera) { PostRender_General(CommandBufferExecutorBRP.GetInstance(), camera); - //throw new NotImplementedException(); } private static void PreUpdateCallback() @@ -250,7 +242,7 @@ namespace DCFApixels if (_lastUnityTime < Time.unscaledTimeAsDouble) { _timeTicks++; - if (_pauseState == PauseStateX.Unpaused) + if (_pauseState == DebugXPauseState.Unpaused) { _deltaTime = Time.unscaledDeltaTime * _timeScaleCache; } @@ -269,9 +261,9 @@ namespace DCFApixels } } _lastUnityTime = Time.unscaledTimeAsDouble; - if (_pauseState == PauseStateX.PreUnpaused) + if (_pauseState == DebugXPauseState.PreUnpaused) { - _pauseState = PauseStateX.Unpaused; + _pauseState = DebugXPauseState.Unpaused; } SetGameSceneContext(); } @@ -294,7 +286,6 @@ namespace DCFApixels _currentCamera = camera; } - private static void PostRender_General(ICommandBufferExecutor cbExecutor, Camera camera) { if (_lastEditorToRenderTicks != _editorTicks) @@ -542,8 +533,6 @@ namespace DCFApixels { _buffers[i].Render(cbExecutor); } - - //RunEnd(); } } @@ -559,8 +548,6 @@ namespace DCFApixels { _buffers[i].PostRender(); } - - //RunEnd(); } } From 30f93a7d4cc825e5d4627bf57a1237d0d21b3f4f Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:18:49 +0800 Subject: [PATCH 10/14] fix text background/ rework text world space scaling --- Runtime/Gizmos/DebugX.text.cs | 139 +++++++++--------- Runtime/Materials/TextBackground.mat | 135 +++++++++++++++++ Runtime/Materials/TextBackground.mat.meta | 8 + .../DCFApixels.DebugX/MaterialsList.prefab | 87 +++++++++++ Runtime/Shaders/TextBackground.shader | 59 ++++++++ Runtime/Shaders/TextBackground.shader.meta | 9 ++ Runtime/Utils/DebugXAssets.cs | 2 + Runtime/Utils/DebugXTextSettings.cs | 28 ++-- Runtime/Utils/DebugXUtility.cs | 2 +- Samples/Sample.unity | 2 +- Samples/Scripts/DebugXSample_Other.cs | 6 +- 11 files changed, 394 insertions(+), 83 deletions(-) create mode 100644 Runtime/Materials/TextBackground.mat create mode 100644 Runtime/Materials/TextBackground.mat.meta create mode 100644 Runtime/Shaders/TextBackground.shader create mode 100644 Runtime/Shaders/TextBackground.shader.meta diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 22aade5..7188307 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -14,24 +14,20 @@ namespace DCFApixels public readonly partial struct DrawHandler { #region Text - [IN(LINE)] public DrawHandler TextWorldScale(Vector3 position, object text) => Gizmo(new TextGizmo(position, text, DebugXTextSettings.Default, true)); - [IN(LINE)] public DrawHandler TextWorldScale(Vector3 position, object text, DebugXTextSettings settings) => Gizmo(new TextGizmo(position, text, settings, true)); - [IN(LINE)] public DrawHandler Text(Vector3 position, object text) => Gizmo(new TextGizmo(position, text, DebugXTextSettings.Default, false)); - [IN(LINE)] public DrawHandler Text(Vector3 position, object text, DebugXTextSettings settings) => Gizmo(new TextGizmo(position, text, settings, false)); + [IN(LINE)] public DrawHandler Text(Vector3 position, object text) => Gizmo(new TextGizmo(position, text, DebugXTextSettings.Default)); + [IN(LINE)] public DrawHandler Text(Vector3 position, object text, DebugXTextSettings settings) => Gizmo(new TextGizmo(position, text, settings)); private readonly struct TextGizmo : IGizmo { public readonly Vector3 Position; public readonly string Text; public readonly DebugXTextSettings Settings; - public readonly bool IsWorldSpaceScale; [IN(LINE)] - public TextGizmo(Vector3 position, object text, DebugXTextSettings settings, bool isWorldSpaceScale) + public TextGizmo(Vector3 position, object text, DebugXTextSettings settings) { Position = position; Text = text.ToString(); Settings = settings; - IsWorldSpaceScale = isWorldSpaceScale; } public IGizmoRenderer RegisterNewRenderer() { return new Renderer(); } @@ -39,7 +35,7 @@ namespace DCFApixels #region Renderer private class Renderer : IGizmoRenderer_PostRender { - private static GUIStyle _labelStyle; + private static GUIStyle _labelStyle; private static GUIContent _labelDummy; private static Texture2D _whiteTexture; public int ExecuteOrder => default(UnlitMat).GetExecuteOrder(); @@ -48,14 +44,15 @@ namespace DCFApixels public void Render(Camera camera, GizmosList list, CommandBuffer cb) { } public void PostRender(Camera camera, GizmosList list) { + if (camera == null) { return; } if (Event.current.type != EventType.Repaint) { return; } Color dfColor = GUI.color; - - if (camera == null) { return; } InitStatic(); - var zoom = GetCameraZoom(camera); bool isSceneView = false; + var backgroundMaterial = DebugXAssets.Materials.TextBackground; + #if UNITY_EDITOR + //TODO костыльный вариант, нужно поискать более надежный способ определить рендер SceneView isSceneView = camera.name == "SceneCamera"; #endif @@ -68,7 +65,6 @@ namespace DCFApixels else { GL.PushMatrix(); - //GL.LoadPixelMatrix(0, Screen.width, Screen.height - (isSceneView ? 50 : 0), 0); GL.LoadPixelMatrix(0, Screen.width, Screen.height, 0); } foreach (ref readonly var item in list) @@ -76,26 +72,25 @@ namespace DCFApixels _labelDummy.text = item.Value.Text; GUIStyle style = _labelStyle; - style.fontSize = item.Value.IsWorldSpaceScale - ? Mathf.FloorToInt(item.Value.Settings.FontSize / zoom) - : item.Value.Settings.FontSize; + var zoom = GetCameraZoom(camera, item.Value.Position); + + style.fontSize = Mathf.FloorToInt(Mathf.Lerp(item.Value.Settings.FontSize, item.Value.Settings.FontSize / zoom, item.Value.Settings.WorldSpaceScaleFactor)); style.alignment = item.Value.Settings.TextAnchor; if (!(WorldToGUIPointWithDepth(camera, item.Value.Position).z < 0f)) { Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle); - Color c = item.Value.Settings.BackgroundColor * GlobalColor; - var mat = DebugXAssets.Materials.Unlit; - mat.SetColor(ColorPropertyID, c); - Graphics.DrawTexture(rect, _whiteTexture, mat); + Color backgroundColor = item.Value.Settings.BackgroundColor * GlobalColor; + backgroundMaterial.SetColor(ColorPropertyID, backgroundColor); + Graphics.DrawTexture(rect, _whiteTexture, backgroundMaterial); GUI.color = item.Color * GlobalColor; style.Draw(rect, _labelDummy, false, false, false, false); } } GUI.color = dfColor; - DebugXAssets.Materials.Unlit.SetColor(ColorPropertyID, Color.white); + backgroundMaterial.SetColor(ColorPropertyID, Color.white); if (isSceneView) { @@ -109,6 +104,46 @@ namespace DCFApixels } } + #region Init + private void InitStatic() + { + if (_labelStyle == null || _labelDummy == null || _whiteTexture == null) + { + GUIStyleState GenerateGUIStyleState() + { + var result = new GUIStyleState(); + result.textColor = Color.white; + result.background = null; + return result; + } + GUISkin skin = (GUISkin)typeof(GUI).GetField("s_Skin", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null); //GUI.s_Skin + //GUISkin skin = GUI.skin; + _labelStyle = new GUIStyle(skin.label) + { + richText = false, + padding = new RectOffset(1, 1, 0, 0), + margin = new RectOffset(0, 0, 0, 0), + normal = GenerateGUIStyleState(), + active = GenerateGUIStyleState(), + hover = GenerateGUIStyleState(), + focused = GenerateGUIStyleState(), + }; + + _labelDummy = new GUIContent(); + + _whiteTexture = new Texture2D(2, 2); + Color32[] color = new Color32[] + { + Color.white, + Color.white, + Color.white, + Color.white, + }; + _whiteTexture.SetPixels32(color); + _whiteTexture.Apply(); + } + } + #endregion #region Utils public static Vector3 WorldToGUIPointWithDepth(Camera camera, Vector3 world) @@ -162,56 +197,25 @@ namespace DCFApixels } return style.padding.Add(rect); } - #endregion - - - private void InitStatic() + private static float GetCameraZoom(Camera camera, Vector3 position) { - if (_labelStyle == null || _labelDummy == null || _whiteTexture == null) - { - GUIStyleState GenerateGUIStyleState() - { - var result = new GUIStyleState(); - result.textColor = Color.white; - result.background = null; - return result; - } - GUISkin skin = (GUISkin)typeof(GUI).GetField("s_Skin", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null); //GUI.s_Skin - //GUISkin skin = GUI.skin; - _labelStyle = new GUIStyle(skin.label) - { - richText = false, - padding = new RectOffset(1, 1, 1, 1), - margin = new RectOffset(0, 0, 0, 0), - normal = GenerateGUIStyleState(), - active = GenerateGUIStyleState(), - hover = GenerateGUIStyleState(), - focused = GenerateGUIStyleState(), - }; + position = Handles.matrix.MultiplyPoint(position); + Transform transform = camera.transform; + Vector3 position2 = transform.position; + float z = Vector3.Dot(position - position2, transform.TransformDirection(new Vector3(0f, 0f, 1f))); + Vector3 vector = camera.WorldToScreenPoint(position2 + transform.TransformDirection(new Vector3(0f, 0f, z))); + Vector3 vector2 = camera.WorldToScreenPoint(position2 + transform.TransformDirection(new Vector3(1f, 0f, z))); + float magnitude = (vector - vector2).magnitude; + return 80f / Mathf.Max(magnitude, 0.0001f) * EditorGUIUtility.pixelsPerPoint; - _labelDummy = new GUIContent(); - _whiteTexture = new Texture2D(2, 2); - Color32[] color = new Color32[] - { - new Color32(255,255,255,255), - new Color32(255,255,255,255), - new Color32(255,255,255,255), - new Color32(255,255,255,255), - }; - _whiteTexture.SetPixels32(color); - _whiteTexture.Apply(); - } - } - private static float GetCameraZoom(Camera camera) - { - const float DEFAULT_ZOOM = 1f; - - if (camera != null) - { - return camera.orthographicSize; - } - return DEFAULT_ZOOM; + //const float DEFAULT_ZOOM = 1f; + // + //if (camera != null) + //{ + // return camera.orthographicSize; + //} + //return DEFAULT_ZOOM; //var currentDrawingSceneView = SceneView.currentDrawingSceneView; // @@ -229,6 +233,7 @@ namespace DCFApixels // //return DEFAULT_ZOOM; } + #endregion } #endregion } diff --git a/Runtime/Materials/TextBackground.mat b/Runtime/Materials/TextBackground.mat new file mode 100644 index 0000000..32b9923 --- /dev/null +++ b/Runtime/Materials/TextBackground.mat @@ -0,0 +1,135 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TextBackground + m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &1974214919826471110 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 diff --git a/Runtime/Materials/TextBackground.mat.meta b/Runtime/Materials/TextBackground.mat.meta new file mode 100644 index 0000000..98922e1 --- /dev/null +++ b/Runtime/Materials/TextBackground.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 75409b93d220f694aa75eee6f4bfd840 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab b/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab index 71cb551..624affb 100644 --- a/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab +++ b/Runtime/Resources/DCFApixels.DebugX/MaterialsList.prefab @@ -86,6 +86,92 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &549390746132496352 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7483746332942052062} + - component: {fileID: 6763744428275037148} + - component: {fileID: 387838602774759695} + m_Layer: 0 + m_Name: TextBackground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7483746332942052062 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 549390746132496352} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 12.5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2844384060761577604} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6763744428275037148 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 549390746132496352} + m_Mesh: {fileID: 4300000, guid: 873de0939b7f76947a258a8897199a8e, type: 2} +--- !u!23 &387838602774759695 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 549390746132496352} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 75409b93d220f694aa75eee6f4bfd840, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!1 &1299980064020930364 GameObject: m_ObjectHideFlags: 0 @@ -292,6 +378,7 @@ Transform: - {fileID: 2770005348449356163} - {fileID: 5119875421667202613} - {fileID: 1046323005297189095} + - {fileID: 7483746332942052062} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6563773915565914195 diff --git a/Runtime/Shaders/TextBackground.shader b/Runtime/Shaders/TextBackground.shader new file mode 100644 index 0000000..6266f5d --- /dev/null +++ b/Runtime/Shaders/TextBackground.shader @@ -0,0 +1,59 @@ +Shader "DCFApixels/DebugX/TextBackground" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + } + SubShader + { + Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off Fog { Mode Off } + Lighting Off + ZTest Off + + Pass + { + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + float4 color : COLOR; + }; + + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_DEFINE_INSTANCED_PROP(float4, _Color) + UNITY_INSTANCING_BUFFER_END(Props) + + float4 _DebugX_GlobalColor; + + v2f vert (appdata_t v) + { + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + o.vertex = UnityObjectToClipPos(v.vertex); + o.color = v.color * UNITY_ACCESS_INSTANCED_PROP(Props, _Color) * _DebugX_GlobalColor; + return o; + } + + float4 frag (v2f i) : SV_Target + { + return i.color * float4(1, 1, 1, 2); + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Runtime/Shaders/TextBackground.shader.meta b/Runtime/Shaders/TextBackground.shader.meta new file mode 100644 index 0000000..b8042f8 --- /dev/null +++ b/Runtime/Shaders/TextBackground.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1af3913ae49e790418a8d901f8982caf +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Utils/DebugXAssets.cs b/Runtime/Utils/DebugXAssets.cs index 1a4d4ef..b7f61f5 100644 --- a/Runtime/Utils/DebugXAssets.cs +++ b/Runtime/Utils/DebugXAssets.cs @@ -47,6 +47,8 @@ namespace DCFApixels.DebugXCore public readonly Material Billboard; public readonly Material Dot; public readonly Material Wire; + + internal readonly Material TextBackground; } } } \ No newline at end of file diff --git a/Runtime/Utils/DebugXTextSettings.cs b/Runtime/Utils/DebugXTextSettings.cs index 8bba295..fb5d9f8 100644 --- a/Runtime/Utils/DebugXTextSettings.cs +++ b/Runtime/Utils/DebugXTextSettings.cs @@ -2,40 +2,44 @@ namespace DCFApixels { - public struct DebugXTextSettings + public readonly struct DebugXTextSettings { public const TextAnchor DEFAULT_TEXT_ANCHOR = TextAnchor.MiddleLeft; public const int DEFAULT_FONT_SIZE = 16; - public static readonly DebugXTextSettings Default = new DebugXTextSettings(DEFAULT_FONT_SIZE, DEFAULT_TEXT_ANCHOR, default); + public static readonly DebugXTextSettings Default = new DebugXTextSettings(DEFAULT_FONT_SIZE, DEFAULT_TEXT_ANCHOR, default, 0); + public static readonly DebugXTextSettings WorldSpaceScale = Default.SetWorldSpaceScaleFactor(1f); - public int FontSize; - public TextAnchor TextAnchor; - public Color BackgroundColor; + public readonly int FontSize; + public readonly TextAnchor TextAnchor; + public readonly Color BackgroundColor; + public readonly float WorldSpaceScaleFactor; public bool IsHasBackground { get { return BackgroundColor.a > 0; } } - public DebugXTextSettings(int fontSize, TextAnchor textAnchor, Color backgroundColor) + public DebugXTextSettings(int fontSize, TextAnchor textAnchor, Color backgroundColor, float worldSpaceScaleFactor) { FontSize = fontSize; TextAnchor = textAnchor; BackgroundColor = backgroundColor; + WorldSpaceScaleFactor = worldSpaceScaleFactor; } public DebugXTextSettings SetSize(int fontSize) { - FontSize = fontSize; - return this; + return new DebugXTextSettings(fontSize, TextAnchor, BackgroundColor, WorldSpaceScaleFactor); } public DebugXTextSettings SetAnchor(TextAnchor textAnchor) { - TextAnchor = textAnchor; - return this; + return new DebugXTextSettings(FontSize, textAnchor, BackgroundColor, WorldSpaceScaleFactor); } public DebugXTextSettings SetBackground(Color backgroundColor) { - BackgroundColor = backgroundColor; - return this; + return new DebugXTextSettings(FontSize, TextAnchor, backgroundColor, WorldSpaceScaleFactor); + } + public DebugXTextSettings SetWorldSpaceScaleFactor(float factor) + { + return new DebugXTextSettings(FontSize, TextAnchor, BackgroundColor, factor); } } } \ No newline at end of file diff --git a/Runtime/Utils/DebugXUtility.cs b/Runtime/Utils/DebugXUtility.cs index 57f3d0b..c3f4bca 100644 --- a/Runtime/Utils/DebugXUtility.cs +++ b/Runtime/Utils/DebugXUtility.cs @@ -41,7 +41,7 @@ namespace DCFApixels.DebugXCore field.SetValue(obj, meshFilter.sharedMesh); } else - { + { Debug.LogWarning(field.Name + " not found."); } } diff --git a/Samples/Sample.unity b/Samples/Sample.unity index dd247d0..608f33e 100644 --- a/Samples/Sample.unity +++ b/Samples/Sample.unity @@ -4137,7 +4137,7 @@ GameObject: m_Layer: 0 m_Name: Hello World m_TagString: Untagged - m_Icon: {fileID: 7866945982896999795, guid: 0000000000000000d000000000000000, type: 0} + m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 diff --git a/Samples/Scripts/DebugXSample_Other.cs b/Samples/Scripts/DebugXSample_Other.cs index 71c06a1..866d0f0 100644 --- a/Samples/Scripts/DebugXSample_Other.cs +++ b/Samples/Scripts/DebugXSample_Other.cs @@ -8,7 +8,6 @@ namespace DCFApixels.DebugXCore.Samples public Gradient Gradient; public float GradientMultiplier = 5; public Transform[] Points; - private static readonly Color _background = new Color(0, 0, 0, 0.5f); #if UNITY_EDITOR private void OnDrawGizmos() @@ -29,7 +28,10 @@ namespace DCFApixels.DebugXCore.Samples i++; DebugX.Draw(GetColor(Points[i])).Cross(Points[i].position, Points[i].localScale.x); i++; DebugX.Draw(GetColor(Points[i])).BillboardCircle(Points[i].position, Points[i].localScale.x * RADIUS_M); i++; DebugX.Draw(GetColor(Points[i])).WireMesh(Points[i].position, Points[i].rotation, Points[i].localScale * RADIUS_M); - i++; DebugX.Draw(GetColor(Points[i])).Text(Points[i].position, Points[i].name, DebugXTextSettings.Default.SetBackground(Color.black)); + Color backgroundColor = Color.white - GetColor(Points[i]); + //backgroundColor.a = 1; + backgroundColor.a = 0.5f; + i++; DebugX.Draw(GetColor(Points[i])).Text(Points[i].position, Points[i].name, DebugXTextSettings.Default.SetBackground(backgroundColor)); i++; DebugX.Draw(GetColor(Points[i])).Dot(Points[i].position); i++; DebugX.Draw(GetColor(Points[i])).WireDot(Points[i].position); From e41c45d73f8887e84b9a71815e951c5c3922c7a4 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:20:58 +0800 Subject: [PATCH 11/14] fix --- Runtime/Materials/TextBackground.mat | 2 +- Samples/Scripts/DebugXSample_Other.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Runtime/Materials/TextBackground.mat b/Runtime/Materials/TextBackground.mat index 32b9923..88444a5 100644 --- a/Runtime/Materials/TextBackground.mat +++ b/Runtime/Materials/TextBackground.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: TextBackground - m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: 1af3913ae49e790418a8d901f8982caf, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] diff --git a/Samples/Scripts/DebugXSample_Other.cs b/Samples/Scripts/DebugXSample_Other.cs index 866d0f0..b5602dd 100644 --- a/Samples/Scripts/DebugXSample_Other.cs +++ b/Samples/Scripts/DebugXSample_Other.cs @@ -29,7 +29,6 @@ namespace DCFApixels.DebugXCore.Samples i++; DebugX.Draw(GetColor(Points[i])).BillboardCircle(Points[i].position, Points[i].localScale.x * RADIUS_M); i++; DebugX.Draw(GetColor(Points[i])).WireMesh(Points[i].position, Points[i].rotation, Points[i].localScale * RADIUS_M); Color backgroundColor = Color.white - GetColor(Points[i]); - //backgroundColor.a = 1; backgroundColor.a = 0.5f; i++; DebugX.Draw(GetColor(Points[i])).Text(Points[i].position, Points[i].name, DebugXTextSettings.Default.SetBackground(backgroundColor)); From ab74e1f4d416ff159ef7911a5ef5b76e56eaf61f Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:27:26 +0800 Subject: [PATCH 12/14] Update DebugXSample_Other.cs --- Samples/Scripts/DebugXSample_Other.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/Scripts/DebugXSample_Other.cs b/Samples/Scripts/DebugXSample_Other.cs index b5602dd..d92b640 100644 --- a/Samples/Scripts/DebugXSample_Other.cs +++ b/Samples/Scripts/DebugXSample_Other.cs @@ -30,7 +30,7 @@ namespace DCFApixels.DebugXCore.Samples i++; DebugX.Draw(GetColor(Points[i])).WireMesh(Points[i].position, Points[i].rotation, Points[i].localScale * RADIUS_M); Color backgroundColor = Color.white - GetColor(Points[i]); backgroundColor.a = 0.5f; - i++; DebugX.Draw(GetColor(Points[i])).Text(Points[i].position, Points[i].name, DebugXTextSettings.Default.SetBackground(backgroundColor)); + i++; DebugX.Draw(GetColor(Points[i])).Text(Points[i].position, Points[i].name, DebugXTextSettings.WorldSpaceScale.SetSize(26).SetBackground(backgroundColor)); i++; DebugX.Draw(GetColor(Points[i])).Dot(Points[i].position); i++; DebugX.Draw(GetColor(Points[i])).WireDot(Points[i].position); From 63f94fd7a81db072ed6cecee63faed56375d8a4c Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:28:46 +0800 Subject: [PATCH 13/14] update sample --- Samples/Other/FakeLightMat.mat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/Other/FakeLightMat.mat b/Samples/Other/FakeLightMat.mat index bc772f3..486aec6 100644 --- a/Samples/Other/FakeLightMat.mat +++ b/Samples/Other/FakeLightMat.mat @@ -54,6 +54,6 @@ Material: - _QueueControl: 0 - _QueueOffset: 0 m_Colors: - - _Color: {r: 0, g: 0.071999975, b: 0.09, a: 1} + - _Color: {r: 0, g: 0.08608696, b: 0.11, a: 1} m_BuildTextureStacks: [] m_AllowLocking: 1 From 435c522b0ce59db0e8f167cb70e784b0cdc899d3 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Fri, 28 Feb 2025 12:38:59 +0800 Subject: [PATCH 14/14] final text background fix --- Runtime/Gizmos/DebugX.text.cs | 5 +---- Runtime/Shaders/TextBackground.shader | 14 ++------------ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 7188307..b84dd9f 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -80,11 +80,8 @@ namespace DCFApixels if (!(WorldToGUIPointWithDepth(camera, item.Value.Position).z < 0f)) { Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle); - Color backgroundColor = item.Value.Settings.BackgroundColor * GlobalColor; - backgroundMaterial.SetColor(ColorPropertyID, backgroundColor); - Graphics.DrawTexture(rect, _whiteTexture, backgroundMaterial); - + Graphics.DrawTexture(rect, _whiteTexture, new Rect(0, 0, 1, 1), 0, 0, 0, 0, backgroundColor, backgroundMaterial, -1); GUI.color = item.Color * GlobalColor; style.Draw(rect, _labelDummy, false, false, false, false); } diff --git a/Runtime/Shaders/TextBackground.shader b/Runtime/Shaders/TextBackground.shader index 6266f5d..c1ca2f1 100644 --- a/Runtime/Shaders/TextBackground.shader +++ b/Runtime/Shaders/TextBackground.shader @@ -1,9 +1,5 @@ Shader "DCFApixels/DebugX/TextBackground" { - Properties - { - _Color ("Color", Color) = (1,1,1,1) - } SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } @@ -25,7 +21,6 @@ Shader "DCFApixels/DebugX/TextBackground" { float4 vertex : POSITION; float4 color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f @@ -34,24 +29,19 @@ Shader "DCFApixels/DebugX/TextBackground" float4 color : COLOR; }; - UNITY_INSTANCING_BUFFER_START(Props) - UNITY_DEFINE_INSTANCED_PROP(float4, _Color) - UNITY_INSTANCING_BUFFER_END(Props) - float4 _DebugX_GlobalColor; v2f vert (appdata_t v) { v2f o; - UNITY_SETUP_INSTANCE_ID(v); o.vertex = UnityObjectToClipPos(v.vertex); - o.color = v.color * UNITY_ACCESS_INSTANCED_PROP(Props, _Color) * _DebugX_GlobalColor; + o.color = v.color * _DebugX_GlobalColor; return o; } float4 frag (v2f i) : SV_Target { - return i.color * float4(1, 1, 1, 2); + return i.color; } ENDCG }