This commit is contained in:
DCFApixels 2025-02-22 17:25:54 +08:00
parent a828e5d9ac
commit 24ffa4f4a5
119 changed files with 16445 additions and 2 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

1
.gitignore vendored
View File

@ -59,7 +59,6 @@ sysinfo.txt
*.apk
*.aab
*.unitypackage
*.unitypackage.meta
*.app
# Crashlytics generated file

14
DebugX.asmdef Normal file
View File

@ -0,0 +1,14 @@
{
"name": "DCFApixels.DebugX",
"rootNamespace": "DCFApixels",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

7
DebugX.asmdef.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1139531e2a3a6bd4c8ad2bc68ae00719
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Editor.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69b88b9c96288ed4bbd865e41090f8db
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Editor/Settings.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2aa216c9de30dac4fbd278883c463d15
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace DCFApixels.DebugXCore.Internal
{
internal class DebugXSettings : EditorWindow
{
[MenuItem("Tools/DebugX/Settings")]
private static void Open()
{
DebugXSettings window = (DebugXSettings)EditorWindow.GetWindow(typeof(DebugXSettings));
window.Show();
}
private void OnGUI()
{
float tmpValue;
DebugX.GlobalTimeScale = EditorGUILayout.FloatField("TimeScale", DebugX.GlobalTimeScale);
EditorGUI.BeginChangeCheck();
tmpValue = EditorGUILayout.Slider(DebugX.GlobalTimeScale, 0, 2);
if (EditorGUI.EndChangeCheck())
{
DebugX.GlobalTimeScale = tmpValue;
}
DebugX.GlobalDotSize = EditorGUILayout.FloatField("DotSize", DebugX.GlobalDotSize);
EditorGUI.BeginChangeCheck();
tmpValue = EditorGUILayout.Slider(DebugX.GlobalDotSize, 0, 2);
if (EditorGUI.EndChangeCheck())
{
DebugX.GlobalDotSize = tmpValue;
}
DebugX.GlobalColor = EditorGUILayout.ColorField("Color", DebugX.GlobalColor);
Color color = DebugX.GlobalColor;
color.a = EditorGUILayout.Slider(DebugX.GlobalColor.a, 0, 1);
DebugX.GlobalColor = color;
if (GUILayout.Button("Reset"))
{
DebugX.ResetGlobals();
}
if (GUILayout.Button("Clear All Gizmos"))
{
DebugX.ClearAllGizmos();
}
}
}
}
#endif

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bc3681ae976053d4b8a19a105ae0b81e

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 Mikhail
Copyright (c) 2025 DCFApixels
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

BIN
LICENSE.meta Normal file

Binary file not shown.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Unity-DebugX
![image](https://github.com/user-attachments/assets/fb3edbce-9164-4ad7-a7a2-85748edf58e0)

7
README.md.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f7937e1a77861c4448a0275c638017bc
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Runtime.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 98079f62e17df38458ef9a2e4d04cd14
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

33
Runtime/Consts.cs Normal file
View File

@ -0,0 +1,33 @@
using System.Runtime.CompilerServices;
using UnityEngine;
namespace DCFApixels
{
public static partial class DebugX
{
internal const MethodImplOptions LINE = MethodImplOptions.AggressiveInlining;
private const float MinTime = 0f;
private static readonly Color DefaultColor = Color.white;
private const float DOT_SIZE = DOT_RADIUS * 2f;
private const float DOT_RADIUS = 0.05f;
private const float BackfaceAlphaMultiplier = 0.3f;
internal readonly static int ColorPropertyID = Shader.PropertyToID("_Color");
internal readonly static int GlobalDotSizePropertyID = Shader.PropertyToID("_DebugX_GlobalDotSize");
internal readonly static int GlobalColorPropertyID = Shader.PropertyToID("_DebugX_GlobalColor");
private readonly static bool IsSRP;
private readonly static bool IsSupportsComputeShaders = SystemInfo.supportsComputeShaders;
public const float IMMEDIATE_DURATION = -1;
}
public enum DebugXLine
{
Default,
Arrow,
Fade,
}
}

2
Runtime/Consts.cs.meta Normal file
View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 22628015b1c17ea43a12c150546ea369

898
Runtime/DebugX.cs Normal file
View File

@ -0,0 +1,898 @@
//#undef DEBUG
#if DEBUG
#define DEV_MODE
#endif
using System;
using DCFApixels.DebugXCore;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
using Unity.Collections.LowLevel.Unsafe;
using DCFApixels.DebugXCore.Internal;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace DCFApixels
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
#if UNITY_EDITOR
// [InitializeOnLoad]
#endif
public static unsafe partial class DebugX
{
private static PauseStateX _pauseState = PauseStateX.Unpaused;
private static bool _isCameraContext = false;
private static ulong _lastEditorTicks = 1000;
private static double _lastUnityTime;
private static float _deltaTime = 0;
private static ulong _editorTicks = 0;
private static ulong _renderTicks = 100;
private static ulong _timeTicks = 0;
#region Globals
private const string GlobalTimeScalePrefName = "DCFApixels.DebugX.TimeScale";
private static float _timeScaleCache;
public static float GlobalTimeScale
{
get { return _timeScaleCache; }
set
{
value = Mathf.Max(0f, value);
if (_timeScaleCache == value) { return; }
_timeScaleCache = value;
#if UNITY_EDITOR
EditorPrefs.SetFloat(GlobalTimeScalePrefName, value);
#endif
}
}
private const string GlobalDotSizePrefName = "DCFApixels.DebugX.DotSize";
private static float _dotSizeCache;
public static float GlobalDotSize
{
get { return _dotSizeCache; }
set
{
if (_dotSizeCache == value) { return; }
_dotSizeCache = value;
Shader.SetGlobalFloat(GlobalDotSizePropertyID, _dotSizeCache);
#if UNITY_EDITOR
EditorPrefs.SetFloat(GlobalDotSizePrefName, _dotSizeCache);
#endif
}
}
private const string GlobalColorPrefName = "DCFApixels.DebugX.Color";
private static Color _globalColorCache;
public static Color GlobalColor
{
get { return _globalColorCache; }
set
{
if (_globalColorCache == value) { return; }
_globalColorCache = value;
Shader.SetGlobalVector(nameID: GlobalColorPropertyID, _globalColorCache);
Color32 c32 = (Color32)value;
var record = *(int*)&c32;
#if UNITY_EDITOR
EditorPrefs.SetInt(GlobalColorPrefName, record);
#endif
}
}
public static void ResetGlobals()
{
#if UNITY_EDITOR
EditorPrefs.DeleteKey(GlobalTimeScalePrefName);
EditorPrefs.DeleteKey(GlobalDotSizePrefName);
EditorPrefs.DeleteKey(GlobalColorPrefName);
_dotSizeCache = default;
_timeScaleCache = default;
_globalColorCache = default;
InitGlobals();
#endif
}
public static void InitGlobals()
{
GlobalTimeScale = 1;
GlobalDotSize = 1;
GlobalColor = Color.white;
#if UNITY_EDITOR
GlobalTimeScale = EditorPrefs.GetFloat(GlobalTimeScalePrefName, 1f);
GlobalDotSize = EditorPrefs.GetFloat(GlobalDotSizePrefName, 1f);
var colorCode = EditorPrefs.GetInt(GlobalColorPrefName, -1);
GlobalColor = (Color)(*(Color32*)&colorCode);
#endif
}
#endregion
#region Other
public static void ClearAllGizmos()
{
RenderContextController.ClearAllGizmos();
}
private static void SetCameraContext()
{
_isCameraContext = true;
}
private static void SetGameSceneContext()
{
_isCameraContext = false;
}
private enum PauseStateX
{
Unpaused = 0,
PreUnpaused = 1, //íóæíî ÷òîáû îòùåëêóíòü ïàóçó ñ çàäåðæêîé â îäèí òèê
Paused = 2,
}
#if UNITY_EDITOR
private static void EditorApplication_pauseStateChanged(PauseState obj)
{
_pauseState = obj == PauseState.Paused ? PauseStateX.Paused : PauseStateX.PreUnpaused;
}
#endif
#endregion
#region ctor
static DebugX()
{
InitGlobals();
Meshes = LoadMeshesList(new MeshesList(), $"DCFApixels.DebugX/MeshesList");
IsSRP = GraphicsSettings.currentRenderPipeline != null;
if (IsSRP)
{
RenderPipelineManager.beginCameraRendering -= OnPreRender_SRP;
RenderPipelineManager.beginCameraRendering += OnPreRender_SRP;
RenderPipelineManager.endCameraRendering -= OnPostRender_SRP;
RenderPipelineManager.endCameraRendering += OnPostRender_SRP;
}
else
{
Camera.onPreRender -= OnPreRender_BRP;
Camera.onPreRender += OnPreRender_BRP;
Camera.onPostRender -= OnPostRender_BRP;
Camera.onPostRender += OnPostRender_BRP;
}
var curentLoop = PlayerLoop.GetCurrentPlayerLoop();
var systemsList = curentLoop.subSystemList;
for (int i = 0; i < systemsList.Length; i++)
{
ref var system = ref systemsList[i];
if (system.type == typeof(EarlyUpdate))
{
system.updateDelegate -= PreUpdateCallback;
system.updateDelegate += PreUpdateCallback;
}
if (system.type == typeof(PostLateUpdate))
{
system.updateDelegate -= PreRenderCallback;
system.updateDelegate += PreRenderCallback;
}
}
curentLoop.subSystemList = systemsList;
PlayerLoop.SetPlayerLoop(curentLoop);
//Application.onBeforeRender -= Application_onBeforeRender;
//Application.onBeforeRender += Application_onBeforeRender;
#if UNITY_EDITOR
EditorApplication.pauseStateChanged -= EditorApplication_pauseStateChanged;
EditorApplication.pauseStateChanged += EditorApplication_pauseStateChanged;
EditorApplication.update -= EditorApplication_update;
EditorApplication.update += EditorApplication_update;
#endif
}
#endregion
#region Draw/DrawHandler
public static DrawHandler Draw()
{
return new DrawHandler(MinTime, DefaultColor);
}
public static DrawHandler Draw(float duration)
{
return new DrawHandler(duration, DefaultColor);
}
public static DrawHandler Draw(Color color)
{
return new DrawHandler(MinTime, color);
}
public static DrawHandler Draw(float duration, Color color)
{
return new DrawHandler(duration, color);
}
public readonly partial struct DrawHandler
{
public readonly Color Color;
public readonly float Duration;
//private readonly RenderContextController ContextController;
//public Camera Camera
//{
// get { return ContextController.Context.Camera; }
//}
[IN(LINE)]
public DrawHandler(float time, Color color)
{
Color = color;
Duration = time;
//ContextController = GetCurrenRenderContextController();
}
[IN(LINE)] public DrawHandler Setup(float duration, Color color) => new DrawHandler(duration, color);
[IN(LINE)] public DrawHandler Setup(float duration) => new DrawHandler(duration, Color);
[IN(LINE)] public DrawHandler Setup(Color color) => new DrawHandler(Duration, color);
//[IN(LINE)]
//private DrawHandler(float time, Color color, RenderContextController contextController)
//{
// Color = color;
// Duration = time;
// ContextController = contextController;
//}
//[IN(LINE)] public DrawHandler Setup(float duration, Color color) => new DrawHandler(duration, color, ContextController);
//[IN(LINE)] public DrawHandler Setup(float duration) => new DrawHandler(duration, Color, ContextController);
//[IN(LINE)] public DrawHandler Setup(Color color) => new DrawHandler(Duration, color, ContextController);
//[IN(LINE)] public DrawHandler Setup(Camera camera) => new DrawHandler(Duration, Color, ContextController.Context.Camera != camera ? RenderContextController.GetController(new RenderContext(camera)) : ContextController);
}
#endregion
#region Gizmo data
internal struct GizmoInternal<T> where T : IGizmo<T>
{
public readonly T Value;
public readonly Color Color;
public float Timer;
//public int IsSwaped;
[IN(LINE)]
public GizmoInternal(T value, float timer, Color color)
{
Value = value;
Timer = timer;
Color = color;
//IsSwaped = -1;
}
}
public readonly struct Gizmo<T>
{
public readonly T Value;
public readonly Color Color;
public readonly float Timer;
public Gizmo(T value, Color color, float timer)
{
Value = value;
Color = color;
Timer = timer;
}
//public readonly int IsSwaped;
public override string ToString()
{
return $"{Color} {Timer}";
}
}
#endregion
#region Render Callbacks
private static void OnPreRender_SRP(ScriptableRenderContext context, Camera camera)
{
PreRender_General(camera);
}
private static void OnPostRender_SRP(ScriptableRenderContext context, Camera camera)
{
PostRender_General(new CBExecutor(context), camera);
context.Submit();
}
private static void OnPreRender_BRP(Camera camera)
{
PreRender_General(camera);
//throw new NotImplementedException();
}
private static void OnPostRender_BRP(Camera camera)
{
PostRender_General(default, camera);
//throw new NotImplementedException();
}
public static ulong RenderTicks
{
get { return _renderTicks; }
}
public static ulong TimeTicks
{
get { return _timeTicks; }
}
private static void PreUpdateCallback()
{
_editorTicks++;
_currentCamera = null;
if (_lastUnityTime < Time.unscaledTimeAsDouble)
{
_timeTicks++;
if (_pauseState == PauseStateX.Unpaused)
{
_deltaTime = Time.unscaledDeltaTime * _timeScaleCache;
}
else
{
const float Min = 1f / 200f;
const float Max = 1f / 20f;
if (_deltaTime < Min || _deltaTime > Max)
{
_deltaTime = Max;
}
}
for (int i = 0, iMax = GizmosBuffer.All.Count; i < iMax; i++)
{
GizmosBuffer.All[i].UpdateTimer(_deltaTime);
}
}
_lastUnityTime = Time.unscaledTimeAsDouble;
if (_pauseState == PauseStateX.PreUnpaused)
{
_pauseState = PauseStateX.Unpaused;
}
SetGameSceneContext();
}
private static void PreRenderCallback()
{
RenderContextController.ClearCommandBuffers();
SetCameraContext();
_currentCamera = null;
}
private static void EditorApplication_update()
{
_editorTicks++;
}
private static void PreRender_General(Camera camera)
{
if (camera == null) { return; }
_currentCamera = camera;
}
private static void PostRender_General(CBExecutor cbExecutor, Camera camera)
{
if (_lastEditorTicks != _editorTicks)
{
_renderTicks++;
_lastEditorTicks = _editorTicks;
}
if (IsGizmosRender())
{
RenderContextController.StaicContextController.Prepare();
RenderContextController.StaicContextController.Render(cbExecutor);
}
if (camera == null) { return; }
_currentCamera = camera;
RenderContextController contextController = RenderContextController.GetController(new RenderContext(camera));
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
[DrawGizmo(GizmoType.NonSelected | GizmoType.Selected)]
private static void DrawGizmos(Camera obj, GizmoType gizmoType)
{
if (obj != Camera.main) { return; }
Camera camera = Camera.current;
Color guiColor = GUI.color;
Color gizmosColor = Gizmos.color;
Color handlesColor = Handles.color;
GL.MultMatrix(Handles.matrix);
RenderContextController.StaicContextController.Render_UnityGizmos();
if (camera == null) { return; }
_currentCamera = camera;
RenderContextController.GetController(new RenderContext(camera)).Render_UnityGizmos();
GUI.color = guiColor;
Gizmos.color = gizmosColor;
Handles.color = handlesColor;
}
#endif
#endregion
#region Gizmo Method
private static Camera _currentCamera;
private static Camera GetCurrentCamera()
{
return _currentCamera == null ? Camera.current : _currentCamera;
}
private static RenderContextController _currenRenderContextControler;
public readonly partial struct DrawHandler
{
[IN(LINE)]
public DrawHandler Gizmo<T>(T value) where T : IGizmo<T>
{
GetCurrentContextController().Add(value, Duration, Color);
return this;
}
[IN(LINE)]
public DrawHandler Gizmos<T>(ReadOnlySpan<T> values) where T : IGizmo<T>
{
GetCurrentContextController().AddRange(values, Duration, Color);
return this;
}
private static RenderContextController GetCurrentContextController()
{
//RenderContextController controller;
//if (ContextController == null)
//{
// controller = DrawHandler.GetCurrentContextController();
//}
//else
//{
// controller = ContextController;
//}
//return controller;
if (_isCameraContext)
{
if (_currenRenderContextControler.Context.Camera != GetCurrentCamera())
{
_currenRenderContextControler = RenderContextController.GetController(new RenderContext(Camera.current));
}
}
else
{
_currenRenderContextControler = RenderContextController.StaicContextController;
}
return _currenRenderContextControler;
}
}
#endregion
#region RenderContextControler
private class RenderContextController
{
private static readonly Dictionary<RenderContext, RenderContextController> _allControllers = new Dictionary<RenderContext, RenderContextController>();
private static readonly RenderContextController _staicContextController;
private static readonly CommandBuffer _staticContextBuffer;
static RenderContextController()
{
_staticContextBuffer = new CommandBuffer();
_staticContextBuffer.name = "DebugX_StaticContextRender";
//_staicContextController = new RenderContextControler(new RenderContext(null), _staticContextBuffer);
_staicContextController = GetController(new RenderContext(null));
}
public static IEnumerable<RenderContextController> AllConteollers
{
get { return _allControllers.Values; }
}
public static RenderContextController StaicContextController
{
get { return _staicContextController; }
}
public static RenderContextController GetController(RenderContext context)
{
if (_allControllers.TryGetValue(context, out RenderContextController result) == false)
{
CommandBuffer cb;
if (context.Camera == null)
{
cb = _staticContextBuffer;
}
else
{
cb = new CommandBuffer();
cb.name = "DebugX_CameraContextRender";
}
result = new RenderContextController(context, cb);
//TODO òóò ìîæåò áûòü óòå÷êà
_allControllers.Add(context, result);
}
return result;
}
public static void ClearCommandBuffers()
{
foreach (var item in _allControllers)
{
item.Value.commandBuffer.Clear();
}
}
public static void UpdateControllersList()
{
}
public static void ClearAllGizmos()
{
foreach (var controller in AllConteollers)
{
foreach (var buffer in controller._buffers)
{
buffer.Clear();
}
}
}
public readonly RenderContext Context;
private readonly CommandBuffer commandBuffer;
private GizmosBuffer[] _buffersMap = Array.Empty<GizmosBuffer>();
private readonly List<GizmosBuffer> _buffers = new List<GizmosBuffer>();
private readonly Unity.Profiling.ProfilerMarker _cameraMarker;
//private long _version;
//private long _lastVersion;
//private void IncrementVersion()
//{
// System.Threading.Interlocked.Increment(ref _version);
//}
private RenderContextController(RenderContext context, CommandBuffer cb)
{
Context = context;
commandBuffer = cb;
_cameraMarker = new Unity.Profiling.ProfilerMarker($"{Context.Camera}");
_buffersMap = new GizmosBuffer[GizmoTypeCode.TypesCount];
//TODO òóò ìîæåò áûòü óòå÷êà
GizmoTypeCode.OnAddNewID += TypeCode_OnAddNewID;
}
private void TypeCode_OnAddNewID(int count)
{
Array.Resize(ref _buffersMap, NextPow2(count));
}
[IN(LINE)]
public void Add<T>(T value, float time, Color color) where T : IGizmo<T>
{
GetBuffer<T>().Add(value, time, color);
}
[IN(LINE)]
public void AddRange<T>(ReadOnlySpan<T> values, float time, Color color) where T : IGizmo<T>
{
GetBuffer<T>().AddRange(values, time, color);
}
[IN(LINE)]
private GizmosBuffer<T> GetBuffer<T>() where T : IGizmo<T>
{
int id = GizmoTypeCode<T>.ID;
if (_buffersMap[id] == null)
{
var result = new GizmosBuffer<T>(Context, commandBuffer);
_buffersMap[id] = result;
_buffers.Add(result);
_buffers.Sort((a, b) => a.ExecuteOrder - b.ExecuteOrder);
return result;
}
else
{
return UnsafeUtility.As<GizmosBuffer, GizmosBuffer<T>>(ref _buffersMap[id]);
}
}
//[IN(LINE)]
//public void UpdateTimer(float deltaTime)
//{
// int removed = 0;
// for (int i = 0, iMax = _buffers.Count; i < iMax; i++)
// {
// removed |= _buffers[i].UpdateTimer(deltaTime);
// }
// //if(removed > 0)
// //{
// // IncrementVersion();
// //}
//}
[IN(LINE)]
public void Prepare()
{
#if UNITY_EDITOR
using (_cameraMarker.Auto())
#endif
{
for (int i = 0, iMax = _buffers.Count; i < iMax; i++)
{
_buffers[i].Prepare();
}
}
}
[IN(LINE)]
public void Render(CBExecutor cbExecutor)
{
#if UNITY_EDITOR
using (_cameraMarker.Auto())
#endif
{
for (int i = 0, iMax = _buffers.Count; i < iMax; i++)
{
_buffers[i].Render(cbExecutor);
}
RunEnd();
}
}
[IN(LINE)]
public void Render_UnityGizmos()
{
#if UNITY_EDITOR
using (_cameraMarker.Auto())
#endif
{
for (int i = 0, iMax = _buffers.Count; i < iMax; i++)
{
_buffers[i].Render_UnityGizmos();
}
}
}
public void RunEnd()
{
int removed = 0;
for (int i = 0, iMax = _buffers.Count; i < iMax; i++)
{
removed |= _buffers[i].RunEnd();
}
//if (removed > 0)
//{
// IncrementVersion();
//}
}
}
#endregion
#region GizmosBuffer
private abstract class GizmosBuffer
{
public readonly static List<GizmosBuffer> All = new List<GizmosBuffer>();
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_UnityGizmos();
public abstract int RunEnd();
public abstract void Clear();
}
private class GizmosBuffer<T> : GizmosBuffer where T : IGizmo<T>
{
private class DummyRenderer : IGizmoRenderer<T>
{
public int ExecuteOrder { get { return 0; } }
public bool IsStaticRender { get { return true; } }
public void Prepare(Camera camera, GizmosList<T> list) { }
public void Render(Camera camera, GizmosList<T> list, CommandBuffer cb) { }
}
private StructList<GizmoInternal<T>> _gizmos = new StructList<GizmoInternal<T>>(32);
private readonly string _debugName;
private readonly RenderContext _context;
private readonly CommandBuffer _staticCommandBuffer;
//private readonly CommandBuffer _dynamicCommandBuffer;
private readonly IGizmoRenderer<T> _renderer;
private readonly IGizmoRenderer_UnityGizmos<T> _rendererUnityGizmos;
private readonly bool _isStatic;
#if DEV_MODE
private static readonly Unity.Profiling.ProfilerMarker _timerMarker = new Unity.Profiling.ProfilerMarker($"{GetGenericTypeName_Internal(typeof(T), 3, false)}.{nameof(UpdateTimer)}");
private static readonly Unity.Profiling.ProfilerMarker _prepareMarker = new Unity.Profiling.ProfilerMarker($"{GetGenericTypeName_Internal(typeof(T), 3, false)}.{nameof(Prepare)}");
private static readonly Unity.Profiling.ProfilerMarker _renderMarker = new Unity.Profiling.ProfilerMarker($"{GetGenericTypeName_Internal(typeof(T), 3, false)}.{nameof(Render)}");
#endif
public GizmosBuffer(RenderContext context, CommandBuffer cb)
{
Type type = typeof(T);
_context = context;
_staticCommandBuffer = cb;
_debugName = GetGenericTypeName_Internal(type, 3, false);
//_dynamicCommandBuffer = new CommandBuffer();
//_dynamicCommandBuffer.name = _debugName;
_renderer = default(T).RegisterNewRenderer();
if (_renderer == null)
{
_renderer = new DummyRenderer();
}
_isStatic = _renderer.IsStaticRender;
_rendererUnityGizmos = _renderer as IGizmoRenderer_UnityGizmos<T>;
All.Add(this);
All.Sort((a, b) => a.ExecuteOrder - b.ExecuteOrder);
}
[IN(LINE)]
public void Add(T value, float time, Color color)
{
_gizmos.Add(new GizmoInternal<T>(value, time, color));
}
[IN(LINE)]
public void AddRange(ReadOnlySpan<T> values, float time, Color color)
{
_gizmos.UpSize(_gizmos._count + values.Length);
for (int i = 0; i < values.Length; i++)
{
_gizmos.Add(new GizmoInternal<T>(values[i], time, color));
}
}
public override int ExecuteOrder { get { return _renderer.ExecuteOrder; } }
private static readonly bool _isUnmanaged = UnsafeUtility.IsUnmanaged(typeof(T));
public sealed override int UpdateTimer(float deltaTime)
{
_staticCommandBuffer.Clear();
int removeCount = 0;
#if DEV_MODE
using (_timerMarker.Auto())
#endif
{
for (int i = 0; i < _gizmos.Count; i++)
{
ref var item = ref _gizmos._items[i];
if (item.Timer <= 0)
{
_gizmos.FastRemoveAt(i);
i--;
removeCount++;
continue;
}
item.Timer -= deltaTime;
}
}
return removeCount;
}
public sealed override int RunEnd()
{
int removeCount = 0;
#if DEV_MODE
using (_timerMarker.Auto())
#endif
{
int lastCount = _gizmos.Count;
for (int i = 0; i < _gizmos.Count; i++)
{
ref var item = ref _gizmos._items[i];
if (item.Timer < 0)
{
_gizmos.FastRemoveAt(i);
i--;
removeCount++;
continue;
}
}
//ìèêðîîïòèìèçàöèÿ, óäàëÿþòñÿ åëåìåíòû áåç çàíóëåíèÿ, è òóò çàíóëÿþòñÿ òîëüêî managed òèïû
if (_isUnmanaged == false)
{
for (int i = _gizmos.Count; i < lastCount; i++)
{
_gizmos._items[i] = default;
}
}
}
return removeCount;
}
private ulong _prepareLastRenderTicks = 0;
public override void Prepare()
{
if (_gizmos.Count <= 0) { return; }
#if DEV_MODE
using (_prepareMarker.Auto())
#endif
{
if (_isStatic == false || _prepareLastRenderTicks != _renderTicks)
{
_prepareLastRenderTicks = _renderTicks;
GizmosList<T> list = GizmosList.From(_gizmos._items, _gizmos._count);
try
{
_renderer.Prepare(GetCurrentCamera(), list);
}
catch (Exception e) { throw new Exception($"[{_debugName}] [Prepare] ", e); }
}
}
}
private ulong _renderLastRenderTicks = 0;
public override void Render(CBExecutor cbExecutor)
{
if (_gizmos.Count <= 0) { return; }
#if DEV_MODE
using (_renderMarker.Auto())
#endif
{
//if (_isStatic == false || _renderLastRenderTicks != _renderTicks)
{
_renderLastRenderTicks = _renderTicks;
GizmosList<T> list = GizmosList.From(_gizmos._items, _gizmos._count);
try
{
_staticCommandBuffer.Clear();
_renderer.Render(GetCurrentCamera(), list, _staticCommandBuffer);
}
catch (Exception e) { throw new Exception($"[{_debugName}] [Render] ", e); }
}
cbExecutor.Execute(_staticCommandBuffer);
}
}
public override void Render_UnityGizmos()
{
if (_rendererUnityGizmos == null) { return; }
if (_gizmos.Count <= 0) { return; }
#if DEV_MODE
using (_renderMarker.Auto())
#endif
{
GizmosList<T> list = GizmosList.From(_gizmos._items, _gizmos._count);
try
{
_rendererUnityGizmos.Render_UnityGizmos(GetCurrentCamera(), list);
}
catch (Exception e) { throw new Exception($"[{_debugName}] [Render] ", e); }
}
}
public override void Clear()
{
if (_isUnmanaged)
{
_gizmos.FastClear();
}
else
{
_gizmos.Clear();
}
}
}
#endregion
}
}

2
Runtime/DebugX.cs.meta Normal file
View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e9d419d5313e7ff48a7a8e9561e30b17

8
Runtime/Gizmos.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b4ea287971497fd448a4721fc2513808
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,600 @@
//#undef DEBUG
using DCFApixels.DebugXCore;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using UnityEngine;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace DCFApixels
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
public static unsafe partial class DebugX
{
public readonly partial struct DrawHandler
{
#region Lambda //TODO
//[IN(LINE)]
//public DrawHandler Lambda(Action<(Color color, float duration)> drawCallback)
//{
// return Gizmo(new LambdaGizmo(drawCallback));
//}
//private readonly struct LambdaGizmo : IGizmo<LambdaGizmo>
//{
// public readonly Action<(Color color, float duration)> Action;
// [IN(LINE)] public LambdaGizmo(Action<(Color color, float duration)> action) { Action = action; }
// public IGizmoRenderer<LambdaGizmo> RegisterNewRenderer() => new Renderer();
// private class Renderer : IGizmoRenderer<LambdaGizmo>
// {
// public int ExecuteOrder => 0;
// public bool IsStaticRender => false;
// public void Prepare(Camera camera, GizmosList<LambdaGizmo> list) { }
// public void Render(Camera camera, GizmosList<LambdaGizmo> list, CommandBuffer cb)
// {
// foreach (var item in list)
// {
// item.Value.Action((item.Color, item.Timer));
// }
// }
// }
//}
#endregion
#region Mesh //TODO потестить
[IN(LINE)]
public DrawHandler Mesh<TMat>(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 size)
where TMat : struct, IStaticMaterial
{
return Gizmo(new MeshGizmo<TMat>(mesh, position, rotation, size));
}
[IN(LINE)]
public DrawHandler Mesh(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 size)
{
return Gizmo(new MeshGizmo<LitMat>(mesh, position, rotation, size));
}
[IN(LINE)]
public DrawHandler UnlitMesh(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 size)
{
return Gizmo(new MeshGizmo<UnlitMat>(mesh, position, rotation, size));
}
[IN(LINE)]
public DrawHandler WireMesh(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 size)
{
return Gizmo(new MeshGizmo<WireMat>(mesh, position, rotation, size));
}
private readonly struct MeshGizmoLayout
{
public readonly Mesh Mesh;
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
public MeshGizmoLayout(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 size)
{
Mesh = mesh;
Rotation = rotation;
Position = position;
Size = size;
}
}
private readonly struct MeshGizmo<TMat> : IGizmo<MeshGizmo<TMat>>
where TMat : struct, IStaticMaterial
{
public readonly Mesh Mesh;
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
[IN(LINE)]
public MeshGizmo(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 size)
{
Mesh = mesh;
Position = position;
Rotation = rotation;
Size = size;
}
public IGizmoRenderer<MeshGizmo<TMat>> RegisterNewRenderer() { return new Renderer(); }
private class Renderer : MeshRendererBase, IGizmoRenderer<MeshGizmo<TMat>>
{
public Renderer() : base(default(TMat)) { }
public void Prepare(Camera camera, GizmosList<MeshGizmo<TMat>> list)
{
Prepare(list);
}
public void Render(Camera camera, GizmosList<MeshGizmo<TMat>> list, CommandBuffer cb)
{
Render(cb);
}
}
}
#endregion
#region InstancingMesh
[IN(LINE)]
public DrawHandler Mesh<TMesh, TMat>(Vector3 position, Quaternion rotation, Vector3 size)
where TMesh : struct, IStaticMesh
where TMat : struct, IStaticMaterial
{
return Gizmo(new InstancingMeshGizmo<TMesh, TMat>(position, rotation, size));
}
[IN(LINE)]
public DrawHandler Mesh<TMesh>(Vector3 position, Quaternion rotation, Vector3 size)
where TMesh : struct, IStaticMesh
{
return Gizmo(new InstancingMeshGizmo<TMesh, LitMat>(position, rotation, size));
}
[IN(LINE)]
public DrawHandler UnlitMesh<TMesh>(Vector3 position, Quaternion rotation, Vector3 size)
where TMesh : struct, IStaticMesh
{
return Gizmo(new InstancingMeshGizmo<TMesh, UnlitMat>(position, rotation, size));
}
[IN(LINE)]
public DrawHandler WireMesh<TMesh>(Vector3 position, Quaternion rotation, Vector3 size)
where TMesh : struct, IStaticMesh
{
return Gizmo(new InstancingMeshGizmo<TMesh, WireMat>(position, rotation, size));
}
private readonly struct InstancingMeshGizmoLayout
{
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
public InstancingMeshGizmoLayout(Vector3 position, Quaternion rotation, Vector3 size)
{
Rotation = rotation;
Position = position;
Size = size;
}
}
private readonly struct InstancingMeshGizmo<TMesh, TMat> : IGizmo<InstancingMeshGizmo<TMesh, TMat>>
where TMesh : struct, IStaticMesh
where TMat : struct, IStaticMaterial
{
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
[IN(LINE)]
public InstancingMeshGizmo(Vector3 position, Quaternion rotation, Vector3 size)
{
Rotation = rotation;
Position = position;
Size = size;
}
public IGizmoRenderer<InstancingMeshGizmo<TMesh, TMat>> RegisterNewRenderer() { return new Renderer(); }
private class Renderer : InstancingMeshRendererBase, IGizmoRenderer<InstancingMeshGizmo<TMesh, TMat>>
{
public Renderer() : base(default(TMesh), default(TMat)) { }
public void Prepare(Camera camera, GizmosList<InstancingMeshGizmo<TMesh, TMat>> list)
{
Prepare(list);
}
public void Render(Camera camera, GizmosList<InstancingMeshGizmo<TMesh, TMat>> list, CommandBuffer cb)
{
Render(cb);
}
}
}
#endregion
#region Line
[IN(LINE)]
public DrawHandler Line<TMat>(Vector3 start, Vector3 end)
where TMat : struct, IStaticMaterial
{
return Gizmo(new WireLineGizmo<TMat>(start, end));
}
[IN(LINE)]
public DrawHandler Line(Vector3 start, Vector3 end)
{
return Gizmo(new WireLineGizmo<UnlitMat>(start, end));
}
private readonly struct WireLineGizmo<TMat> : IGizmo<WireLineGizmo<TMat>>
where TMat : struct, IStaticMaterial
{
public readonly Vector3 Start;
public readonly Vector3 End;
[IN(LINE)]
public WireLineGizmo(Vector3 start, Vector3 end)
{
Start = start;
End = end;
}
public IGizmoRenderer<WireLineGizmo<TMat>> RegisterNewRenderer() { return new Renderer(); }
private class Renderer : WireLineRendererBase, IGizmoRenderer<WireLineGizmo<TMat>>
{
public Renderer() : base(default(TMat)) { }
public void Prepare(Camera camera, GizmosList<WireLineGizmo<TMat>> list)
{
Prepare(list);
}
public void Render(Camera camera, GizmosList<WireLineGizmo<TMat>> list, CommandBuffer cb)
{
Render(cb);
}
}
}
#endregion
#region Text
[IN(LINE)] public DrawHandler Text(Vector3 position, object text) => Gizmo(new TextGizmo(position, text));
private readonly struct TextGizmo : IGizmo<TextGizmo>
{
public readonly Vector3 Position;
public readonly string Text;
[IN(LINE)]
public TextGizmo(Vector3 position, object text)
{
Position = position;
Text = text.ToString();
}
public IGizmoRenderer<TextGizmo> RegisterNewRenderer() { return new Renderer(); }
#region Renderer
private class Renderer : IGizmoRenderer_UnityGizmos<TextGizmo>
{
private static GUIStyle _labelStyle;
private static GUIContent _labelDummy;
public int ExecuteOrder => default(UnlitMat).GetExecuteOrder();
public bool IsStaticRender => false;
public void Prepare(Camera camera, GizmosList<TextGizmo> list) { }
public void Render(Camera camera, GizmosList<TextGizmo> list, CommandBuffer cb) { }
public void Render_UnityGizmos(Camera camera, GizmosList<TextGizmo> list)
{
#if UNITY_EDITOR
Color defaultColor = GUI.color;
if (_labelStyle == null || _labelDummy == null)
{
_labelStyle = GUI.skin.label;
_labelStyle.richText = false;
_labelDummy = new GUIContent();
}
Handles.BeginGUI();
foreach (ref readonly var item in list)
{
GUI.color = item.Color * GlobalColor;
_labelDummy.text = item.Value.Text;
if (!(HandleUtility.WorldToGUIPointWithDepth(item.Value.Position).z < 0f))
{
GUI.Label(HandleUtility.WorldPointToSizedRect(item.Value.Position, _labelDummy, _labelStyle), _labelDummy, _labelStyle);
}
}
Handles.EndGUI();
GUI.color = defaultColor;
#endif
}
}
#endregion
}
#endregion
// Base Renderers
#region MeshRendererBase
private class MeshRendererBase
{
private readonly struct GizmoData
{
public readonly Mesh Mesh;
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
}
private readonly struct UnmanagedGizmoData
{
public readonly void* RawMesh;
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
}
private struct PrepareJob : IJobParallelFor
{
[NativeDisableUnsafePtrRestriction]
public Gizmo<UnmanagedGizmoData>* Items;
[NativeDisableUnsafePtrRestriction]
public Matrix4x4* ResultMatrices;
[NativeDisableUnsafePtrRestriction]
public Vector4* ResultColors;
public void Execute(int index)
{
ref readonly var item = ref Items[index];
//if (item.IsSwaped == 0) { return; }
ResultMatrices[index] = Matrix4x4.TRS(item.Value.Position, item.Value.Rotation, item.Value.Size);
ResultColors[index] = item.Color;
}
}
private readonly IStaticMaterial _material;
private int _buffersLength = 0;
private PinnedArray<Matrix4x4> _matrices;
private PinnedArray<Vector4> _colors;
private PinnedArray<Gizmo<UnmanagedGizmoData>> _gizmos;
private readonly MaterialPropertyBlock _materialPropertyBlock;
private JobHandle _jobHandle;
private int _prepareCount = 0;
public virtual int ExecuteOrder => _material.GetExecuteOrder();
public virtual bool IsStaticRender => true;
public MeshRendererBase(IStaticMaterial material)
{
_materialPropertyBlock = new MaterialPropertyBlock();
_material = material;
_matrices = PinnedArray<Matrix4x4>.Pin(DummyArray<Matrix4x4>.Get());
_colors = PinnedArray<Vector4>.Pin(DummyArray<Vector4>.Get());
}
public void Prepare(GizmosList rawList)
{
var list = rawList.As<GizmoData>();
var items = list.Items;
var count = list.Count;
_prepareCount = count;
if (_buffersLength < count)
{
if (_matrices.Array != null)
{
_matrices.Dispose();
_colors.Dispose();
}
_matrices = PinnedArray<Matrix4x4>.Pin(new Matrix4x4[NextPow2(count)]);
_colors = PinnedArray<Color>.Pin(new Color[NextPow2(count)]).As<Vector4>();
_buffersLength = count;
}
if (ReferenceEquals(_gizmos.Array, items) == false)
{
if (_gizmos.Array != null)
{
_gizmos.Dispose();
}
var itemsUnmanaged = UnsafeUtility.As<Gizmo<GizmoData>[], Gizmo<UnmanagedGizmoData>[]>(ref items);
_gizmos = PinnedArray<Gizmo<UnmanagedGizmoData>>.Pin(itemsUnmanaged);
}
var job = new PrepareJob
{
Items = _gizmos.Ptr,
ResultMatrices = _matrices.Ptr,
ResultColors = _colors.Ptr,
};
_jobHandle = job.Schedule(count, 64);
}
public void Render(CommandBuffer cb)
{
Material material = _material.GetMaterial();
var items = new GizmosList<UnmanagedGizmoData>(_gizmos.Array, _prepareCount).As<GizmoData>().Items;
_materialPropertyBlock.Clear();
_jobHandle.Complete();
for (int i = 0; i < _prepareCount; i++)
{
ref readonly var item = ref items[i];
_materialPropertyBlock.SetColor(ColorPropertyID, item.Color);
cb.DrawMesh(item.Value.Mesh, _matrices.Ptr[i], material, 0, -1, _materialPropertyBlock);
}
}
}
#endregion
#region InstancingMeshRendererBase
private class InstancingMeshRendererBase
{
private readonly struct GizmoData
{
public readonly Quaternion Rotation;
public readonly Vector3 Position;
public readonly Vector3 Size;
}
private struct PrepareJob : IJobParallelFor
{
[NativeDisableUnsafePtrRestriction]
public Gizmo<GizmoData>* Items;
[NativeDisableUnsafePtrRestriction]
public Matrix4x4* ResultMatrices;
[NativeDisableUnsafePtrRestriction]
public Vector4* ResultColors;
public void Execute(int index)
{
ref readonly var item = ref Items[index];
//if (item.IsSwaped == 0) { return; }
ResultMatrices[index] = Matrix4x4.TRS(item.Value.Position, item.Value.Rotation, item.Value.Size);
ResultColors[index] = item.Color;
}
}
private readonly IStaticMesh _mesh;
private readonly IStaticMaterial _material;
private readonly MaterialPropertyBlock _materialPropertyBlock;
private int _buffersLength = 0;
private PinnedArray<Matrix4x4> _matrices;
private PinnedArray<Vector4> _colors;
private PinnedArray<Gizmo<GizmoData>> _gizmos;
private JobHandle _jobHandle;
private int _prepareCount = 0;
public InstancingMeshRendererBase(IStaticMesh mesh, IStaticMaterial material)
{
_mesh = mesh;
_material = material;
_materialPropertyBlock = new MaterialPropertyBlock();
_matrices = PinnedArray<Matrix4x4>.Pin(DummyArray<Matrix4x4>.Get());
_colors = PinnedArray<Vector4>.Pin(DummyArray<Vector4>.Get());
}
public virtual int ExecuteOrder => _material.GetExecuteOrder();
public virtual bool IsStaticRender => true;
protected void Prepare(GizmosList rawList)
{
var list = rawList.As<GizmoData>();
_prepareCount = list.Count;
var items = list.Items;
var count = list.Count;
if (_buffersLength < count)
{
_matrices.Dispose();
_colors.Dispose();
_matrices = PinnedArray<Matrix4x4>.Pin(new Matrix4x4[NextPow2(count)]);
_colors = PinnedArray<Vector4>.Pin(new Vector4[NextPow2(count)]);
_buffersLength = count;
}
if (ReferenceEquals(_gizmos.Array, items) == false)
{
if (_gizmos.Array != null)
{
_gizmos.Dispose();
}
_gizmos = PinnedArray<Gizmo<GizmoData>>.Pin(items);
}
var job = new PrepareJob
{
Items = _gizmos.Ptr,
ResultMatrices = _matrices.Ptr,
ResultColors = _colors.Ptr,
};
_jobHandle = job.Schedule(count, 64);
}
protected void Render(CommandBuffer cb)
{
Material material = _material.GetMaterial();
Mesh mesh = _mesh.GetMesh();
_materialPropertyBlock.Clear();
_jobHandle.Complete();
if (IsSupportsComputeShaders)
{
_materialPropertyBlock.SetVectorArray(ColorPropertyID, _colors.Array);
cb.DrawMeshInstanced(mesh, 0, material, -1, _matrices.Array, _prepareCount, _materialPropertyBlock);
}
else
{
for (int i = 0; i < _prepareCount; i++)
{
_materialPropertyBlock.SetColor(ColorPropertyID, _colors.Ptr[i]);
cb.DrawMesh(mesh, _matrices.Ptr[i], material, 0, -1, _materialPropertyBlock);
}
}
}
}
#endregion
#region LineRendererBase
private class WireLineRendererBase
{
private readonly struct GizmoData
{
public readonly Vector3 Start;
public readonly Vector3 End;
}
private struct PrepareJob : IJobParallelFor
{
[NativeDisableUnsafePtrRestriction]
public Gizmo<GizmoData>* Items;
[NativeDisableUnsafePtrRestriction]
public Matrix4x4* ResultMatrices;
[NativeDisableUnsafePtrRestriction]
public Vector4* ResultColors;
public void Execute(int index)
{
ref readonly var item = ref Items[index];
Vector3 halfDiff = (item.Value.End - item.Value.Start) * 0.5f;
Vector3 position = item.Value.Start + halfDiff;
ResultMatrices[index] = Matrix4x4.TRS(position, Quaternion.identity, halfDiff);
ResultColors[index] = item.Color;
}
}
private readonly IStaticMesh _mesh = default(WireLineMesh);
private readonly IStaticMaterial _material;
private readonly MaterialPropertyBlock _materialPropertyBlock;
private int _buffersLength = 0;
private PinnedArray<Matrix4x4> _matrices;
private PinnedArray<Vector4> _colors;
private PinnedArray<Gizmo<GizmoData>> _gizmos;
private JobHandle _jobHandle;
private int _prepareCount = 0;
public WireLineRendererBase(IStaticMaterial material)
{
_material = material;
_materialPropertyBlock = new MaterialPropertyBlock();
_matrices = PinnedArray<Matrix4x4>.Pin(DummyArray<Matrix4x4>.Get());
_colors = PinnedArray<Vector4>.Pin(DummyArray<Vector4>.Get());
}
public virtual int ExecuteOrder => _material.GetExecuteOrder();
public virtual bool IsStaticRender => true;
public void Prepare(GizmosList rawList)
{
var list = rawList.As<GizmoData>();
_prepareCount = list.Count;
var items = list.Items;
var count = list.Count;
if (_buffersLength < count)
{
if (_matrices.Array != null)
{
_matrices.Dispose();
_colors.Dispose();
}
_matrices = PinnedArray<Matrix4x4>.Pin(new Matrix4x4[NextPow2(count)]);
_colors = PinnedArray<Vector4>.Pin(new Vector4[NextPow2(count)]);
_buffersLength = count;
}
if (ReferenceEquals(_gizmos.Array, items) == false)
{
if (_gizmos.Array != null)
{
_gizmos.Dispose();
}
_gizmos = PinnedArray<Gizmo<GizmoData>>.Pin(items);
}
var job = new PrepareJob
{
Items = _gizmos.Ptr,
ResultMatrices = _matrices.Ptr,
ResultColors = _colors.Ptr,
};
_jobHandle = job.Schedule(count, 16);
}
public void Render(CommandBuffer cb)
{
Material material = _material.GetMaterial();
Mesh mesh = _mesh.GetMesh();
_materialPropertyBlock.Clear();
_jobHandle.Complete();
if (IsSupportsComputeShaders)
{
_materialPropertyBlock.SetVectorArray(ColorPropertyID, _colors.Array);
cb.DrawMeshInstanced(mesh, 0, material, -1, _matrices.Array, _prepareCount, _materialPropertyBlock);
}
else
{
for (int i = 0; i < _prepareCount; i++)
{
_materialPropertyBlock.SetColor(ColorPropertyID, _colors.Ptr[i]);
cb.DrawMesh(mesh, _matrices.Ptr[i], material, 0, -1, _materialPropertyBlock);
}
}
}
}
#endregion
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0ea79479ee4b85e4d92f876c7c1cfb7c

View File

@ -0,0 +1,329 @@
//#undef DEBUG
using DCFApixels.DebugXCore;
using UnityEngine;
using UnityEngine.Rendering;
namespace DCFApixels
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
public static unsafe partial class DebugX
{
public readonly partial struct DrawHandler
{
//TODO часть функционала рейкастс перенести сюда, типа рисование линий примитивами
#region LineFade
[IN(LINE)]
public DrawHandler LineFade(Vector3 start, Vector3 end)
{
const int StepsCount = 6;
const float Step = 1f / StepsCount;
Color color = Color;
Vector3 startPoint = start;
for (int i = 1; i <= StepsCount; i++)
{
Vector3 endPoint = Vector3.Lerp(start, end, i * Step);
color.a = 1f - Color.a * i * Step;
Setup(color).Line(startPoint, endPoint);
startPoint = endPoint;
}
return this;
}
#endregion
#region LineArrow
[IN(LINE)]
public DrawHandler LineArrow(Vector3 start, Vector3 end)
{
const float MinDistance = 2.5f;
Vector3 direction = end - start;
float distance = FastSqrt(direction.sqrMagnitude);
Quaternion rotation = direction == default ? Quaternion.identity : Quaternion.LookRotation(direction);
var arrowSize = 0.5f;
if (distance < MinDistance)
{
float x = distance / MinDistance;
arrowSize *= x;
}
Line(start, end);
Mesh<ArrowMesh, LitMat>(end, rotation, new Vector3(arrowSize, arrowSize, arrowSize));
return this;
}
#endregion
#region Line custom
[IN(LINE)] public DrawHandler Line(Vector3 start, Vector3 end, DebugXLine endType) => Line(start, end, DebugXLine.Default, endType);
[IN(LINE)]
public DrawHandler Line(Vector3 start, Vector3 end, DebugXLine startType, DebugXLine endType)
{
if (endType == DebugXLine.Default)
{
(end, start, startType, endType) = (start, end, endType, startType);
}
if (startType == DebugXLine.Default)
{
switch (endType)
{
case DebugXLine.Default:
Line(start, end);
break;
case DebugXLine.Arrow:
LineArrow(start, end);
break;
case DebugXLine.Fade:
LineFade(start, end);
break;
//case DebugXLine.Dot:
// Line(start, end);
// Dot(end);
// break;
//case DebugXLine.DotCross:
// Line(start, end);
// DotCross(end);
// break;
//case DebugXLine.DotQuad:
// Line(start, end);
// DotQuad(end);
// break;
//case DebugXLine.DotDiamond:
// Line(start, end);
// DotDiamond(end);
// break;
}
}
else
{
Vector3 center = (start + end) * 0.5f;
Line(center, start, startType);
Line(center, end, endType);
}
return this;
}
#endregion
#region Ray
[IN(LINE)] public DrawHandler Ray(Vector3 origin, Quaternion rotation) => Ray(origin, rotation * Vector3.forward);
[IN(LINE)] public DrawHandler Ray(Ray ray) => Ray(ray.origin, ray.direction);
[IN(LINE)] public DrawHandler Ray(Vector3 origin, Vector3 direction) => Line(origin, origin + direction);
#endregion
#region RayFade
[IN(LINE)] public DrawHandler RayFade(Vector3 origin, Quaternion rotation) => Ray(origin, rotation * Vector3.forward);
[IN(LINE)] public DrawHandler RayFade(Ray ray) => RayFade(ray.origin, ray.direction);
[IN(LINE)] public DrawHandler RayFade(Vector3 origin, Vector3 direction) => LineFade(origin, origin + direction);
#endregion
#region RayArrow
[IN(LINE)] public DrawHandler RayArrow(Vector3 origin, Quaternion rotation) => RayArrow(origin, rotation * Vector3.forward);
[IN(LINE)] public DrawHandler RayArrow(Ray ray) => RayArrow(ray.origin, ray.direction);
[IN(LINE)] public DrawHandler RayArrow(Vector3 origin, Vector3 direction) => LineArrow(origin, origin + direction);
#endregion
#region Ray custom
[IN(LINE)]
public DrawHandler Ray(Vector3 start, Vector3 direction, DebugXLine endType) => Line(start, start + direction, DebugXLine.Default, endType);
public DrawHandler Ray(Vector3 start, Vector3 direction, DebugXLine startType, DebugXLine endType) => Line(start, start + direction, startType, endType);
#endregion
#region WidthLine
[IN(LINE)] public DrawHandler WidthLine(Vector3 start, Vector3 end, float width) => Gizmo(new WidthLineGizmo(start, end, width));
private readonly struct WidthLineGizmo : IGizmo<WidthLineGizmo>
{
public readonly Vector3 Start;
public readonly Vector3 End;
public readonly float HalfWidth;
[IN(LINE)]
public WidthLineGizmo(Vector3 start, Vector3 end, float width)
{
Start = start;
End = end;
HalfWidth = width * 0.5f;
}
public IGizmoRenderer<WidthLineGizmo> RegisterNewRenderer() { return new Renderer(); }
#region Renderer
private class Renderer : IGizmoRenderer<WidthLineGizmo>
{
public int ExecuteOrder => default(UnlitMat).GetExecuteOrder();
public bool IsStaticRender => false;
public void Prepare(Camera camera, GizmosList<WidthLineGizmo> list) { }
public void Render(Camera camera, GizmosList<WidthLineGizmo> list, CommandBuffer cb)
{
default(UnlitMat).GetMaterial().SetPass(0);
GL.Begin(GL.QUADS);
Vector3 cameraPosition = camera.transform.position;
foreach (ref readonly var item in list)
{
GL.Color(item.Color);
item.Value.Draw(cameraPosition);
}
GL.End();
}
}
[IN(LINE)]
public void Draw(Vector3 cameraPosition)
{
Vector3 lineDirection = (End - Start).normalized;
Vector3 cameraDirection = (cameraPosition - Start).normalized;
Vector3 perpendicular = Vector3.Cross(lineDirection, cameraDirection).normalized * HalfWidth;
GL.Vertex(Start - perpendicular);
GL.Vertex(Start + perpendicular);
cameraDirection = (cameraPosition - End).normalized;
perpendicular = Vector3.Cross(lineDirection, cameraDirection).normalized * HalfWidth;
GL.Vertex(End + perpendicular);
GL.Vertex(End - perpendicular);
}
#endregion
}
#endregion
#region WidthOutLine
[IN(LINE)] public DrawHandler WidthOutLine(Vector3 start, Vector3 end, float width) => Gizmo(new WidthOutLineGizmo(start, end, width));
private readonly struct WidthOutLineGizmo : IGizmo<WidthOutLineGizmo>
{
public readonly Vector3 Start;
public readonly Vector3 End;
public readonly float HalfWidth;
[IN(LINE)]
public WidthOutLineGizmo(Vector3 start, Vector3 end, float width)
{
Start = start;
End = end;
HalfWidth = width * 0.5f;
}
public IGizmoRenderer<WidthOutLineGizmo> RegisterNewRenderer() { return new Renderer(); }
#region Renderer
private class Renderer : IGizmoRenderer<WidthOutLineGizmo>
{
public int ExecuteOrder => default(UnlitMat).GetExecuteOrder();
public bool IsStaticRender => false;
public void Prepare(Camera camera, GizmosList<WidthOutLineGizmo> list) { }
public void Render(Camera camera, GizmosList<WidthOutLineGizmo> list, CommandBuffer cb)
{
default(UnlitMat).GetMaterial().SetPass(0);
GL.Begin(GL.LINES);
var cameraPosition = camera.transform.position;
foreach (ref readonly var item in list)
{
GL.Color(item.Color);
item.Value.Draw(cameraPosition);
}
GL.End();
}
}
[IN(LINE)]
public void Draw(Vector3 cameraPosition)
{
Vector3 lineDirection = (End - Start).normalized;
Vector3 cameraDirection = (cameraPosition - Start).normalized;
Vector3 perpendicular = Vector3.Cross(lineDirection, cameraDirection).normalized * HalfWidth;
Vector3 Start1 = Start - perpendicular;
Vector3 Start2 = Start + perpendicular;
cameraDirection = (cameraPosition - End).normalized;
perpendicular = Vector3.Cross(lineDirection, cameraDirection).normalized * HalfWidth;
GL.Vertex(Start1);
GL.Vertex(End - perpendicular);
GL.Vertex(Start2);
GL.Vertex(End + perpendicular);
}
#endregion
}
#endregion
#region ZigzagLine
public DrawHandler ZigzagLine(Vector3 start, Vector3 end) => Gizmo(new ZigzagLineGizmo(start, end, 0.3f));
public DrawHandler ZigzagLine(Vector3 start, Vector3 end, float height) => Gizmo(new ZigzagLineGizmo(start, end, height));
private readonly struct ZigzagLineGizmo : IGizmo<ZigzagLineGizmo>
{
public readonly Vector3 Start;
public readonly Vector3 End;
public readonly float Width;
[IN(LINE)]
public ZigzagLineGizmo(Vector3 start, Vector3 end, float width)
{
Start = start;
End = end;
Width = width;
}
public IGizmoRenderer<ZigzagLineGizmo> RegisterNewRenderer()
{
return new Renderer();
}
#region Renderer
private class Renderer : IGizmoRenderer<ZigzagLineGizmo>
{
public bool IsStaticRender => false;
public int ExecuteOrder => default(UnlitMat).GetExecuteOrder();
public void Prepare(Camera camera, GizmosList<ZigzagLineGizmo> list) { }
public void Render(Camera camera, GizmosList<ZigzagLineGizmo> list, CommandBuffer cb)
{
GL.PushMatrix();
default(UnlitMat).GetMaterial().SetPass(0);
GL.Begin(GL.LINES);
var cameraPosition = camera.transform.position;
foreach (ref readonly var item in list)
{
GL.Color(item.Color);
item.Value.Draw(cameraPosition);
}
GL.End();
GL.PopMatrix();
}
}
[IN(LINE)]
public void Draw(Vector3 cameraPosition)
{
var waveFrequency = 0.75f / Width;
var waveAmplitude = Width / 2f;
Vector3 lineDirection = (End - Start).normalized;
float lineLength = (End - Start).magnitude;
int waveCount = Mathf.FloorToInt(lineLength * waveFrequency) | 1;
Vector3 perpendicularStart = Vector3.Cross(lineDirection, (cameraPosition - Start).normalized).normalized;
Vector3 perpendicularEnd = Vector3.Cross(lineDirection, (cameraPosition - End).normalized).normalized;
Vector3 prevPoint = Start;
float t = 0f;
float addT = 1f / waveCount;
for (int i = 0; i < waveCount - 1; i++)
{
t += addT;
Vector3 pointOnLine = Vector3.Lerp(Start, End, t);
Vector3 perpendicular = Vector3.Lerp(perpendicularStart, perpendicularEnd, t);
int bitFloat = ((i & 1) << 31) | 0x3F800000/* -1f */;
float offset = (*(float*)&bitFloat) * waveAmplitude;
Vector3 nextPoint = pointOnLine + perpendicular * offset;
GL.Vertex(prevPoint);
GL.Vertex(nextPoint);
prevPoint = nextPoint;
}
GL.Vertex(prevPoint);
GL.Vertex(End);
}
#endregion
}
#endregion
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4c6a033bdaff458438cea80ca3f5e89b

View File

@ -0,0 +1,408 @@
//#undef DEBUG
using DCFApixels.DebugXCore;
using System;
using UnityEngine;
using UnityEngine.Rendering;
namespace DCFApixels
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
public unsafe static partial class DebugX
{
public readonly partial struct DrawHandler
{
#region BillboardCircle
[IN(LINE)] public DrawHandler BillboardCircle(Vector3 position, float radius) => Mesh<CircleMesh, BillboardMat>(position, Quaternion.identity, new Vector3(radius, radius, radius));
#endregion
#region Cross
[IN(LINE)] public DrawHandler Cross(Vector3 position, float size) => Mesh<DotCrossMesh, BillboardMat>(position, Quaternion.identity, new Vector3(size, size, size));
#endregion
#region DotCross
[IN(LINE)] public DrawHandler DotCross(Vector3 position) => Mesh<DotCrossMesh, DotMat>(position, Quaternion.identity, new Vector3(0.06f, 0.06f, 0.06f));
#endregion
#region Sphere
[IN(LINE)] public DrawHandler Sphere(Vector3 position, float radius) => Mesh<SphereMesh, LitMat>(position, Quaternion.identity, new Vector3(radius, radius, radius));
#endregion
#region WireSphere
[IN(LINE)]
public DrawHandler WireSphere(Vector3 position, float radius)
{
Mesh<WireSphereMesh, UnlitMat>(position, Quaternion.identity, new Vector3(radius, radius, radius));
Gizmo(new WireSphereGizmo(position, radius));
return this;
}
private readonly struct WireSphereGizmo : IGizmo<WireSphereGizmo>
{
public readonly Vector3 Position;
public readonly float Radius;
[IN(LINE)]
public WireSphereGizmo(Vector3 position, float radius)
{
Position = position;
Radius = radius;
}
public IGizmoRenderer<WireSphereGizmo> RegisterNewRenderer() { return new Renderer(); }
#region Renderer
private class Renderer : InstancingMeshRendererBase, IGizmoRenderer<WireSphereGizmo>
{
private Gizmo<InstancingMeshGizmoLayout>[] _buffer = Array.Empty<Gizmo<InstancingMeshGizmoLayout>>();
public Renderer() : base(default(WireCircleMesh), default(UnlitMat)) { }
public override bool IsStaticRender => false;
public void Prepare(Camera camera, GizmosList<WireSphereGizmo> list)
{
if (camera == null) { return; }
if (_buffer.Length < list.Count)
{
_buffer = new Gizmo<InstancingMeshGizmoLayout>[list.Items.Length];
}
if (camera.orthographic)
{
Quaternion cameraRotation = camera.transform.rotation;
for (int i = 0; i < list.Count; i++)
{
ref readonly var item = ref list[i];
_buffer[i] = new Gizmo<InstancingMeshGizmoLayout>(
new InstancingMeshGizmoLayout(item.Value.Position, cameraRotation, new Vector3(item.Value.Radius, item.Value.Radius, item.Value.Radius)),
item.Color, IMMEDIATE_DURATION);
}
}
else
{
Vector3 cameraPosition = camera.transform.position;
for (int i = 0; i < list.Count; i++)
{
ref readonly var item = ref list[i];
Vector3 vector = item.Value.Position - Matrix4x4.Inverse(Matrix4x4.identity).MultiplyPoint(cameraPosition);
float sqrMagnitude = vector.sqrMagnitude;
float sqrRadius = item.Value.Radius * item.Value.Radius;
float x = sqrRadius * sqrRadius / sqrMagnitude;
if (x / sqrRadius < 1f)
{
float resultSize = FastSqrt(sqrRadius - x);
_buffer[i] = new Gizmo<InstancingMeshGizmoLayout>(
new InstancingMeshGizmoLayout(
item.Value.Position - sqrRadius * vector / sqrMagnitude,
Quaternion.LookRotation((cameraPosition - item.Value.Position).normalized),
new Vector3(resultSize, resultSize, resultSize)),
item.Color, IMMEDIATE_DURATION);
}
}
}
Prepare(new GizmosList<InstancingMeshGizmoLayout>(_buffer, list.Count));
}
public void Render(Camera camera, GizmosList<WireSphereGizmo> list, CommandBuffer cb)
{
if (camera == null) { return; }
Render(cb);
}
}
#endregion
}
#endregion
#region Circle
[IN(LINE)] public DrawHandler Circle(Vector3 position, Vector3 normal, float radius) => Mesh<CircleMesh, LitMat>(position, Quaternion.LookRotation(normal), new Vector3(radius, radius, radius));
[IN(LINE)] public DrawHandler Circle(Vector3 position, Quaternion rotation, float radius) => Mesh<CircleMesh, LitMat>(position, rotation, new Vector3(radius, radius, radius));
#endregion
#region WireCircle
[IN(LINE)] public DrawHandler WireCircle(Vector3 position, Vector3 normal, float radius) => WireCircle(position, Quaternion.LookRotation(normal), radius);
[IN(LINE)] public DrawHandler WireCircle(Vector3 position, Quaternion rotation, float radius) => Mesh<WireCircleMesh, UnlitMat>(position, rotation, new Vector3(radius, radius, radius));
#endregion
#region Dot
[IN(LINE)] public DrawHandler Dot(Vector3 position) => Mesh<DotMesh, DotMat>(position, Quaternion.identity, new Vector3(DOT_RADIUS, DOT_RADIUS, DOT_RADIUS));
#endregion
#region WireDot
[IN(LINE)] public DrawHandler WireDot(Vector3 position) => Mesh<WireCircleMesh, DotMat>(position, Quaternion.identity, new Vector3(DOT_RADIUS / 2, DOT_RADIUS / 2, DOT_RADIUS / 2));
#endregion
#region Capsule
[IN(LINE)]
public DrawHandler Capsule(Vector3 position, Quaternion rotation, float radius, float height)
{
radius = Mathf.Max(0, radius);
height -= radius * 2f;
height = Mathf.Max(0, height);
var halfHeigth = height * 0.5f;
var normal = rotation * Vector3.up;
Mesh<CapsuleHeadMesh, LitMat>(position + normal * halfHeigth, rotation, new Vector3(radius, radius, radius));
Mesh<CapsuleBodyMesh, LitMat>(position, rotation, new Vector3(radius, height, radius));
Mesh<CapsuleHeadMesh, LitMat>(position - normal * halfHeigth, rotation * Quaternion.Euler(0, 0, 180), new Vector3(radius, radius, radius));
return this;
}
#endregion
#region WireCapsule
public DrawHandler WireCapsule(Vector3 point1, Vector3 point2, float radius)
{
//TODO посмотреть поворот
return WireCapsule((point1 + point2) * 0.5f, Quaternion.LookRotation(point2 - point1), radius, Vector3.Distance(point1, point2));
}
public DrawHandler WireCapsule(Vector3 position, Quaternion rotation, float radius, float height)
{
WireFlatCapsule(position, rotation, radius, height);
WireFlatCapsule(position, rotation * Quaternion.Euler(0, 90, 0), radius, height);
radius = Mathf.Max(0, radius);
height -= radius * 2f;
height = Mathf.Max(0, 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);
return this;
}
#endregion
#region FlatCapsule
[IN(LINE)]
public DrawHandler FlatCapsule(Vector3 position, Quaternion rotation, float radius, float height)
{
radius = Mathf.Max(0, radius);
height -= radius * 2f;
height = Mathf.Max(0, height);
var halfHeigth = height * 0.5f;
var normal = rotation * Vector3.up;
Mesh<FlatCapsuleHeadMesh, LitMat>(position + normal * halfHeigth, rotation, new Vector3(radius, radius, radius));
Mesh<FlatCapsuleBodyMesh, LitMat>(position, rotation, new Vector3(radius, height, radius));
Mesh<FlatCapsuleHeadMesh, LitMat>(position - normal * halfHeigth, rotation * Quaternion.Euler(0, 0, 180), new Vector3(radius, radius, radius));
return this;
}
#endregion
#region WireFlatCapsule
private static readonly Quaternion Rot180 = Quaternion.Euler(0, 0, 180);
[IN(LINE)]
public DrawHandler WireFlatCapsule(Vector3 position, Quaternion rotation, float radius, float height)
{
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<WireArcMesh, UnlitMat>(end, rotation, new Vector3(radius, radius, radius));
Mesh<WireArcMesh, UnlitMat>(start, rotation * Rot180, new Vector3(radius, radius, radius));
Vector3 perpendicular = from * radius;
Vector3* lines = stackalloc Vector3[]
{
start - perpendicular,
end - perpendicular,
start + perpendicular,
end + perpendicular,
};
Line(lines[0], lines[1]);
Line(lines[2], lines[3]);
return this;
}
#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);
[IN(LINE)] public DrawHandler Cube(Vector3 position, Quaternion rotation, float size) => Mesh<CubeMesh, LitMat>(position, rotation, new Vector3(size, size, size));
[IN(LINE)] public DrawHandler Cube(Vector3 position, Quaternion rotation, Vector3 size) => Mesh<CubeMesh, LitMat>(position, rotation, size);
#endregion
#region WireCube
//[IN(LINE)] public void WireCube(Vector3 position, float size) => WireCube(position, Quaternion.identity, new Vector3(size, size, size));
//[IN(LINE)] public void WireCube(Vector3 position, Vector3 size) => WireCube(position, Quaternion.identity, size);
[IN(LINE)] public DrawHandler WireCube(Vector3 position, Quaternion rotation, float size) => WireCube(position, rotation, new Vector3(size, size, size));
[IN(LINE)] public DrawHandler WireCube(Vector3 position, Quaternion rotation, Vector3 size) => Mesh<WireCubeMesh, UnlitMat>(position, rotation, size);
#endregion
#region CubePoints
[IN(LINE)] public DrawHandler CubePoints(Vector3 position, Quaternion rotation, float size) => CubePoints(position, rotation, new Vector3(size, size, size));
[IN(LINE)]
public DrawHandler CubePoints(Vector3 position, Quaternion rotation, Vector3 size)
{
Vector3 halfSize = size / 2f;
Vector3* vertices = stackalloc Vector3[]
{
new Vector3(-halfSize.x, -halfSize.y, -halfSize.z), // 0
new Vector3(halfSize.x, -halfSize.y, -halfSize.z), // 1
new Vector3(halfSize.x, -halfSize.y, halfSize.z), // 2
new Vector3(-halfSize.x, -halfSize.y, halfSize.z), // 3
new Vector3(-halfSize.x, halfSize.y, -halfSize.z), // 4
new Vector3(halfSize.x, halfSize.y, -halfSize.z), // 5
new Vector3(halfSize.x, halfSize.y, halfSize.z), // 6
new Vector3(-halfSize.x, halfSize.y, halfSize.z), // 7
};
for (int i = 0; i < 8; i++)
{
Dot(rotation * vertices[i] + position);
}
return this;
}
#endregion
#region CubeGrid
[IN(LINE)] public DrawHandler CubeGrid(Vector3 position, Quaternion rotation, float size, Vector3Int cells) => CubeGrid(position, rotation, new Vector3(size, size, size), cells);
[IN(LINE)]
public unsafe DrawHandler CubeGrid(Vector3 position, Quaternion rotation, Vector3 size, Vector3Int cells)
{
Vector3 halfSize = size / 2f;
Vector3* vertices = stackalloc Vector3[]
{
new Vector3(-halfSize.x, -halfSize.y, -halfSize.z), // 0
new Vector3(halfSize.x, -halfSize.y, -halfSize.z), // 1
new Vector3(halfSize.x, -halfSize.y, halfSize.z), // 2
new Vector3(-halfSize.x, -halfSize.y, halfSize.z), // 3
new Vector3(-halfSize.x, halfSize.y, -halfSize.z), // 4
new Vector3(halfSize.x, halfSize.y, -halfSize.z), // 5
new Vector3(halfSize.x, halfSize.y, halfSize.z), // 6
new Vector3(-halfSize.x, halfSize.y, halfSize.z), // 7
};
for (int i = 0; i < 8; i++)
{
vertices[i] = rotation * vertices[i] + position;
}
Vector3 up = rotation * Vector3.up * (size.y / cells.y);
for (int i = 0; i <= cells.y; i++)
{
Vector3 pos = up * i;
Line(vertices[0] + pos, vertices[1] + pos);
Line(vertices[1] + pos, vertices[2] + pos);
Line(vertices[2] + pos, vertices[3] + pos);
Line(vertices[3] + pos, vertices[0] + pos);
}
Vector3 right = rotation * Vector3.right * (size.x / cells.x);
for (int i = 0; i <= cells.x; i++)
{
Vector3 pos = right * i;
Line(vertices[0] + pos, vertices[3] + pos);
Line(vertices[3] + pos, vertices[7] + pos);
Line(vertices[4] + pos, vertices[0] + pos);
Line(vertices[7] + pos, vertices[4] + pos);
}
Vector3 forward = rotation * Vector3.forward * (size.z / cells.z);
for (int i = 0; i <= cells.z; i++)
{
Vector3 pos = forward * i;
Line(vertices[4] + pos, vertices[5] + pos);
Line(vertices[5] + pos, vertices[1] + pos);
Line(vertices[1] + pos, vertices[0] + pos);
Line(vertices[0] + pos, vertices[4] + pos);
}
return this;
}
#endregion
#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<QuadMesh, LitMat>(position, rotation, new Vector3(size, size, size));
[IN(LINE)] public DrawHandler Quad(Vector3 position, Quaternion rotation, Vector2 size) => Mesh<QuadMesh, LitMat>(position, rotation, size);
#endregion
#region WireQuad
//[IN(LINE)] public DrawHandler WireQuad(Vector3 position, Vector3 normal, float size) => WireQuad(position, Quaternion.LookRotation(normal), new Vector2(size, size));
//[IN(LINE)] public DrawHandler WireQuad(Vector3 position, Vector3 normal, Vector2 size) => WireQuad(position, Quaternion.LookRotation(normal), size);
[IN(LINE)] public DrawHandler WireQuad(Vector3 position, Quaternion rotation, float size) => WireQuad(position, rotation, new Vector2(size, size));
[IN(LINE)] public DrawHandler WireQuad(Vector3 position, Quaternion rotation, Vector2 size) => Mesh<WireCubeMesh, UnlitMat>(position, rotation, size);
#endregion
#region QuadPoints
[IN(LINE)] public DrawHandler QuadPoints(Vector3 position, Quaternion rotation, float size) => QuadPoints(position, rotation, new Vector2(size, size));
[IN(LINE)]
public DrawHandler QuadPoints(Vector3 position, Quaternion rotation, Vector2 size)
{
const int PointsCount = 4;
Vector2 halfSize = size * 0.5f;
Vector3* vertices = stackalloc Vector3[PointsCount]
{
new Vector3(-halfSize.x, -halfSize.y, 0), // 0
new Vector3(halfSize.x, -halfSize.y, 0f), // 1
new Vector3(halfSize.x, halfSize.y, 0f), // 2
new Vector3(-halfSize.x, halfSize.y, 0f), // 3
};
for (int i = 0; i < PointsCount; i++)
{
Dot(rotation * vertices[i] + position);
}
return this;
}
#endregion
#region QuadGrid
[IN(LINE)] public DrawHandler QuadGrid(Vector3 position, Quaternion rotation, float size, Vector2Int сells) => QuadGrid(position, rotation, new Vector2(size, size), сells);
[IN(LINE)]
public DrawHandler QuadGrid(Vector3 position, Quaternion rotation, Vector2 size, Vector2Int сells)
{
Vector2 halfSize = size * 0.5f;
Vector3 Start, End;
Start = rotation * new Vector3(-halfSize.x, -halfSize.y, 0) + position;
End = rotation * new Vector3(-halfSize.x, halfSize.y, 0f) + position;
Vector3 right = rotation * (Vector3.right * size / сells.x);
for (int i = 0; i <= сells.x; i++)
{
Line(Start, End);
Start += right;
End += right;
}
Start = rotation * new Vector3(-halfSize.x, -halfSize.y, 0) + position;
End = rotation * new Vector3(halfSize.x, -halfSize.y, 0f) + position;
Vector3 up = rotation * (Vector3.up * size / сells.y);
for (int i = 0; i <= сells.y; i++)
{
Line(Start, End);
Start += up;
End += up;
}
return this;
}
#endregion
#region DotQuad
[IN(LINE)] public DrawHandler DotQuad(Vector3 position) => Mesh<DotQuadMesh, DotMat>(position, Quaternion.identity, new Vector3(DOT_RADIUS, DOT_RADIUS, DOT_RADIUS));
#endregion
#region DotDiamond
[IN(LINE)] public DrawHandler DotDiamond(Vector3 position) => Mesh<DotDiamondMesh, DotMat>(position, Quaternion.identity, new Vector3(DOT_RADIUS * 0.9f, DOT_RADIUS * 0.9f, DOT_RADIUS * 0.9f));
#endregion
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ec7ff37ecff47ce42b8c4a7d76c6b0ae

View File

@ -0,0 +1,129 @@
//#undef DEBUG
using DCFApixels.DebugXCore.Internal;
using UnityEngine;
namespace DCFApixels
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
public static partial class DebugX
{
private const float ShadowAlphaMultiplier = 0.3f;
public readonly partial struct DrawHandler
{
#region Raycast
[IN(LINE)] public DrawHandler Raycast(Ray ray, RaycastHit hit) => Raycast(ray.origin, ray.direction, hit);
[IN(LINE)]
public DrawHandler Raycast(Vector3 origin, Vector3 direction, RaycastHit hit)
{
if (hit.collider == null)
{
RayFade(origin, direction * 3f);
}
else
{
Line(origin, origin + direction * hit.distance);
DotDiamond(hit.point);
RayArrow(hit.point, hit.normal);
}
return this;
}
#endregion
#region Spherecast
[IN(LINE)] public DrawHandler SphereCast(Ray ray, float radius, RaycastHit hit) => SphereCast(ray.origin, ray.direction, radius, hit);
[IN(LINE)]
public DrawHandler SphereCast(Vector3 origin, Vector3 direction, float radius, RaycastHit hit)
{
WireSphere(origin, radius);
if (hit.collider == null)
{
RayFade(origin, direction * 3f);
}
else
{
Vector3 end = origin + direction * hit.distance;
WidthOutLine(origin, end, radius * 2f);
DotDiamond(hit.point);
WireSphere(end, radius);
RayArrow(hit.point, hit.normal);
Setup(Color.SetAlpha(ShadowAlphaMultiplier)).Line(origin, end);
}
return this;
}
#endregion
#region Spherecast
[IN(LINE)] public DrawHandler BoxCast(Ray ray, Quaternion rotation, Vector3 size, RaycastHit hit) => BoxCast(ray.origin, ray.direction, rotation, size, hit);
[IN(LINE)]
public DrawHandler BoxCast(Vector3 origin, Vector3 direction, Quaternion rotation, Vector3 size, RaycastHit hit)
{
WireCube(origin, rotation, size * 2f);
if (hit.collider == null)
{
RayFade(origin, direction * 3f);
}
else
{
Vector3 end = origin + direction * hit.distance;
WidthOutLine(origin, end, size.x * 2f);
DotDiamond(hit.point);
WireCube(end, rotation, size * 2f);
RayArrow(hit.point, hit.normal);
Setup(Color.SetAlpha(ShadowAlphaMultiplier)).Line(origin, end);
}
return this;
}
#endregion
#region Spherecast
[IN(LINE)]
public DrawHandler CapsuleCast(Vector3 point1, Vector3 point2, Vector3 direction, float radius, RaycastHit hit)
{
Vector3 center = (point1 + point2) * 0.5f;
Quaternion rotation = Quaternion.LookRotation(point2 - point1, Vector3.up);
rotation = rotation * Quaternion.Euler(90, 0, 0);
CapsuleCast(center, direction, rotation, radius, Vector3.Distance(point1, point2) + radius * 2f, hit);
return this;
}
[IN(LINE)]
public DrawHandler CapsuleCast(Ray ray, Vector3 size, Quaternion rotation, float radius, float height, RaycastHit hit)
{
CapsuleCast(ray.origin, ray.direction, rotation, radius, height, hit);
return this;
}
[IN(LINE)]
public DrawHandler CapsuleCast(Vector3 origin, Vector3 direction, Quaternion rotation, float radius, float height, RaycastHit hit)
{
WireCapsule(origin, rotation, radius, height);
if (hit.collider == null)
{
RayFade(origin, direction * 3f);
}
else
{
Vector3 end = origin + direction * hit.distance;
WidthOutLine(origin, end, radius * 2f);
DotDiamond(hit.point);
WireCapsule(end, rotation, radius, height);
RayArrow(hit.point, hit.normal);
Setup(Color.SetAlpha(ShadowAlphaMultiplier)).Line(origin, end);
}
return this;
}
#endregion
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0e6fb19c25b76b44583a920736fc2d59

8
Runtime/Internal.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e03ea31c233f72449c2b0741a24deea
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,13 @@
using UnityEngine;
namespace DCFApixels.DebugXCore.Internal
{
internal static class ColorExtensions
{
public static Color SetAlpha(this Color self, float v)
{
self.a *= v;
return self;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0aa4d751b3780904fa6c43f4a431614b

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
namespace DCFApixels.DebugXCore.Internal
{
internal interface IGizmoTypeCodeAddCallback
{
void OnAddGizmoTypeCode<T>() where T : IGizmo<T>;
}
internal static class GizmoTypeCode<T> where T : IGizmo<T>
{
public static readonly int ID = GizmoTypeCode.NewID();
}
internal static class GizmoTypeCode
{
private static int _increment = 0;
private static readonly object _lock = new object();
private static List<IGizmoTypeCodeAddCallback> _listeners = new List<IGizmoTypeCodeAddCallback>();
public static int TypesCount
{
get { return _increment; }
}
public static int NewID()
{
lock (_lock)
{
_increment++;
OnAddNewID(_increment);
return _increment - 1;
}
}
public static event Action<int> OnAddNewID = delegate { };
public static void AddListener(IGizmoTypeCodeAddCallback listener)
{
_listeners.Add(listener);
}
public static void RemoveListener(IGizmoTypeCodeAddCallback listener)
{
_listeners.Remove(listener);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5da072c37cd9cee448fd7f583aff40ce

View File

@ -0,0 +1,46 @@
using System.Linq;
using System.Reflection;
using UnityEngine;
namespace DCFApixels.DebugXCore.Internal
{
internal static class MeshesListLoader
{
public static T Load<T>(T instance, string path)
{
object obj = instance;
var type = obj.GetType();
var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(o => o.FieldType == typeof(Mesh));
var prefab = Resources.Load<GameObject>(path);
if (prefab == null)
{
Debug.LogError($"{path} not found");
return (T)obj;
}
if (fields.Count() <= 0)
{
Debug.LogError($"{typeof(T).Name} no fields");
return (T)obj;
}
foreach (var field in fields)
{
//if (prefab == null) { continue; }
var child = prefab.transform.Find(field.Name);
var meshFilter = child.GetComponent<MeshFilter>();
if (meshFilter != null)
{
field.SetValue(obj, meshFilter.sharedMesh);
}
else
{
Debug.LogWarning(field.Name + " not found");
}
}
return (T)obj;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2482dd3495375b040ab937f0af691464

8
Runtime/Materials.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9619c5ee054829d4790c4cd8c299f8be
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8282512757102464268
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
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Billboard
m_Shader: {fileID: 4800000, guid: 0fe57c76c30f7274f9ebb46c87d64036, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7dddf4d8e41a47c44ac3ce8ebeb0858c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

135
Runtime/Materials/Dot.mat Normal file
View File

@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8282512757102464268
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
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Dot
m_Shader: {fileID: 4800000, guid: 69efe102f685e6c4cb2e2f25b7f7bdc7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dff4ce10c87c6034186ba9a371bc8c03
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

135
Runtime/Materials/Lit.mat Normal file
View File

@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8282512757102464268
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
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Lit
m_Shader: {fileID: 4800000, guid: b3126f69d0ed1ac439449358fc8a54aa, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 493816cf77c003846870e9a319025383
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

135
Runtime/Materials/Unlit.mat Normal file
View File

@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8282512757102464268
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
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit
m_Shader: {fileID: 4800000, guid: 37036939f3d0a824c82a3f34093d4a42, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ceb677ce98e7f6741859e095d7f04c16
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8282512757102464268
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
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WireLine
m_Shader: {fileID: 4800000, guid: 44b75ed8f4e1d21469ab056c86b4c1a1, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8f56df4773a3c3943a140e27a3155fb0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

8
Runtime/Meshes.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 35818f9da398cd241bdcc291fe92167d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

167
Runtime/Meshes/Arrow.asset Normal file
View File

@ -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: Arrow
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 66
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 48
localAABB:
m_Center: {x: 0, y: 0.0000001937151, z: -0.5}
m_Extent: {x: 0.375, y: 0.375, 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: 00000100020003000400050006000700080009000a000b000c000d000e000f0010001100120013001400150016001700180019001a001b001c001d001e001f00200021002200230024002500260026002700240026002800270028002900270028002a0029002a002b0029002b002c0029002b002d002c002b002e002d002e002f002d00
m_VertexData:
serializedVersion: 3
m_VertexCount: 48
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: 1920
_typelessdata: 0000c0bec2a97234000080bfa77e68bfee2f79befb5eae3e76c6b3be0000000045b36fbf000080bfe146a6beefff3fbe000080bfa77e68bfee2f79befb5eae3e74c6b3be0000000045b36fbf000080bf244912b0feffffb10f0cc330a77e68bfee2f79befb5eae3e74c6b3be0000000045b36fbf000080bfe146a6be1000403e000080bfa77e68bfe82f793efe5eae3e73c6b3be0000000045b36fbf000080bf0000c0bec2a97234000080bfa77e68bfe82f793efe5eae3e74c6b3be0000000045b36fbf000080bf244912b0feffffb10f0cc330a77e68bfe82f793efe5eae3e74c6b3be0000000045b36fbf000080bf000040bee846a63e000080bfab322abfad322a3f005fae3e836ee9be000000005cd863bf000080bfe146a6be1000403e000080bfab322abfad322a3f005fae3e836ee9be000000005cd863bf000080bf244912b0feffffb10f0cc330ab322abfad322a3f005fae3e836ee9be000000005cd863bf000080bf224912b00700c03e000080bfe82f79bea57e683f035fae3ea54a50bf00000000b1d414bf000080bf000040bee846a63e000080bfe82f79bea57e683f035fae3ea54a50bf00000000b1d414bf000080bf244912b0feffffb10f0cc330e82f79bea57e683f035fae3ea54a50bf00000000b0d414bf000080bfe146a6beefff3fbe000080bfaf322abfaa322abff95eae3e846ee9be000000005ad863bf000080bf000040bedb46a6be000080bfaf322abfaa322abff95eae3e846ee9be000000005ad863bf000080bf244912b0feffffb10f0cc330af322abfaa322abff95eae3e846ee9be000000005cd863bf000080bf000040bedb46a6be000080bfec2f79bea77e68bff85eae3ea54a50bf00000000b2d414bf000080bf1f4912b0faffbfbe000080bfec2f79bea77e68bff85eae3ea54a50bf00000000b2d414bf000080bf244912b0feffffb10f0cc330ec2f79bea77e68bff85eae3ea54a50bf00000000b3d414bf000080bf1f4912b0faffbfbe000080bfec2f793ea77e68bff85eae3ea54a50bf00000000b2d4143f000080bf0000403edb46a6be000080bfec2f793ea77e68bff85eae3ea54a50bf00000000b2d4143f000080bf244912b0feffffb10f0cc330ec2f793ea77e68bff85eae3ea54a50bf00000000b3d4143f000080bf0000403edb46a6be000080bfb0322a3faa322abffa5eae3e846ee9be000000005ad8633f000080bfe146a63eefff3fbe000080bfb0322a3faa322abffa5eae3e846ee9be000000005ad8633f000080bf244912b0feffffb10f0cc330b0322a3faa322abffa5eae3e846ee9be000000005cd8633f000080bfe146a63eefff3fbe000080bfa77e683fee2f79befc5eae3e76c6b3be0000000045b36f3f000080bf0000c03ec2a97234000080bfa77e683fee2f79befc5eae3e76c6b3be0000000045b36f3f000080bf244912b0feffffb10f0cc330a77e683fee2f79befc5eae3e75c6b3be0000000045b36f3f000080bf0000c03ec2a97234000080bfa77e683fe82f793efe5eae3e74c6b3be0000000045b36f3f000080bfe146a63e1000403e000080bfa77e683fe82f793efe5eae3e73c6b3be0000000045b36f3f000080bf244912b0feffffb10f0cc330a77e683fe82f793efe5eae3e74c6b3be0000000045b36f3f000080bfe146a63e1000403e000080bfab322a3fad322a3f015fae3e836ee9be000000005cd8633f000080bf0000403ee846a63e000080bfab322a3fad322a3f015fae3e836ee9be000000005cd8633f000080bf244912b0feffffb10f0cc330ab322a3fad322a3f015fae3e836ee9be000000005cd8633f000080bf0000403ee846a63e000080bfe82f793ea57e683f035fae3ea54a50bf00000000b1d4143f000080bf224912b00700c03e000080bfe82f793ea57e683f035fae3ea54a50bf00000000b1d4143f000080bf244912b0feffffb10f0cc330e82f793ea57e683f035fae3ea54a50bf00000000b0d4143f000080bfe146a6beefff3fbe000080bf0000000000000000000080bf000080bf00000000000000000000803f0000c0bec2a97234000080bf0000000000000000000080bf000080bf00000000000000000000803fe146a6be1000403e000080bf0000000000000000000080bf000080bf00000000000000000000803f000040bedb46a6be000080bf0000000000000000000080bf000080bf00000000000000000000803f000040bee846a63e000080bf0000000000000000000080bf000080bf00000000000000000000803f1f4912b0faffbfbe000080bf0000000000000000000080bf000080bf00000000000000000000803f224912b00700c03e000080bf0000000000000000000080bf000080bf00000000000000000000803f0000403ee846a63e000080bf0000000000000000000080bf000080bf00000000000000000000803f0000403edb46a6be000080bf0000000000000000000080bf000080bf00000000000000000000803fe146a63eefff3fbe000080bf0000000000000000000080bf000080bf00000000000000000000803fe146a63e1000403e000080bf0000000000000000000080bf000080bf00000000000000000000803f0000c03ec2a97234000080bf0000000000000000000080bf000080bf00000000000000000000803f
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.0000001937151, z: -0.5}
m_Extent: {x: 0.375, y: 0.375, 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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 32bf5ba487f330849a963c35503a6be9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fce15fb7a59a1ed41aa1b626fd3fd30d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 680b0056ea1c4a94ea8d1151f43aead6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

167
Runtime/Meshes/Circle.asset Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9562c98b68a01114982744ae16e1fc60
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

167
Runtime/Meshes/Dot.asset Normal file
View File

@ -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: Dot
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 18
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.5, y: 0.5, z: 0.00000006755127}
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: 000001000200020003000000020004000300040005000300040006000500060007000500
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
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: 320
_typelessdata: f304b5bef304b5bec2a472b30000000000000000000080bf0000803f0000000000000000000080bf000000bf01000025feffffa40000000000000000000080bf0000803f0000000000000000000080bff304b5bef304b53ec2a472330000000000000000000080bf0000803f0000000000000000000080bf00008031000000bfb41091b30000000000000000000080bf0000803f0000000000000000000080bf000080310000003fb41091330000000000000000000080bf0000803f0000000000000000000080bff304b53ef304b5bec2a472b30000000000000000000080bf0000803f0000000000000000000080bff304b53ef304b53ec2a472330000000000000000000080bf0000803f0000000000000000000080bf0000003f010000a5feffff240000000000000000000080bf0000803f0000000000000000000080bf
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.00000006755127}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 55e9b57fa1749fb44a0a8af31492cf8f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: DotCross
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 12
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.49992818, y: 0.49992818, z: 0.00000003774353}
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: 000001000200000002000300040005000600040006000700
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
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: 320
_typelessdata: d660c4be96f6ff3e731b22b30000000000000000000080bff30435bff30435bf00000000000080bf96f6ff3ed660c4bed1bdf8320000000000000000000080bff30435bff30435bf00000000000080bfd660c43e96f6ffbe731b22330000000000000000000080bff30435bff30435bf00000000000080bf96f6ffbed660c43ed1bdf8b20000000000000000000080bff30435bff30435bf00000000000080bf96f6ffbed960c4bed5bdf8320000000000000000000080bffa04353fec0435bf00000000000080bfd560c43e96f6ff3e731b22b30000000000000000000080bffa04353fec0435bf00000000000080bf96f6ff3ed960c43ed5bdf8b20000000000000000000080bffa04353fec0435bf00000000000080bfd560c4be96f6ffbe731b22330000000000000000000080bffa04353fec0435bf00000000000080bf
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.49992818, y: 0.49992818, z: 0.00000003774353}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: afb2b2e92f0bbc14f90dfd73ec23147e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: DotDiamond
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.7071068, y: 0.7071068, z: 0.000000096981736}
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: 000001000200000002000300
m_VertexData:
serializedVersion: 3
m_VertexCount: 4
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: 160
_typelessdata: f404353f000080324644d0b30000000000000000000080bff30435bff304353f00000000000080bf00000033f40435bf34ce32320000000000000000000080bff30435bff204353f00000000000080bff40435bf000040b34644d0330000000000000000000080bff30435bff304353f00000000000080bf000000b3f404353f34ce32b20000000000000000000080bff30435bff304353f00000000000080bf
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.7071068, y: 0.7071068, z: 0.000000096981736}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9ac643f6b8e4973418e9f71737d86d9c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: FlatCapsuleBody
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 12
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0, z: 0.000000029802322}
m_Extent: {x: 0.99999994, y: 0.5, z: 0.00000012715591}
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: 000001000200000002000300040005000600040006000700
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
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: 320
_typelessdata: ffff7f3f000000bf692122b300000000000000000000803f000080bf0000000000000000000080bfffff7f3f0000003fb410d13300000000000000000000803f000080bf0000000000000000000080bfffff7fbf0000003fb410d13300000000000000000000803f000080bf0000000000000000000080bfffff7fbf000000bf692122b300000000000000000000803f000080bf0000000000000000000080bfffff7f3f000000bfb410d1b30000000000000000000080bf000080bf00000000000000000000803fffff7fbf000000bfb410d1b30000000000000000000080bf000080bf00000000000000000000803fffff7fbf0000003f5a8828340000000000000000000080bf000080bf00000000000000000000803fffff7f3f0000003f5a8828340000000000000000000080bf000080bf00000000000000000000803f
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.000000029802322}
m_Extent: {x: 0.99999994, y: 0.5, z: 0.00000012715591}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 237f8e83fbf23c84b906b853c51a868b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: FlatCapsuleHead
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 90
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 34
localAABB:
m_Center: {x: 0, y: 0.49999627, z: 0.000000057387872}
m_Extent: {x: 1, y: 0.5000037, z: 0.00000019174826}
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: 00000100020002000300000003000400000004000500000005000600000006000700000007000800000008000900000009000a0000000a000b0000000b000c0000000c000d0000000d000e0000000e000f0000000f001000000011001200130013001400110013001500140013001600150013001700160013001800170013001900180013001a00190013001b001a0013001c001b0013001d001c0013001e001d0013001f001e00130020001f00130021002000
m_VertexData:
serializedVersion: 3
m_VertexCount: 34
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: 1360
_typelessdata: 0000803f0000f836b34410340000000000000000000080bf0000803f0000000000000000000080bf000080bf0000f8b6b34410b40000000000000000000080bf0000803f0000000000000000000080bfd6147bbfd8c3473e142506b30000000000000000000080bf0000803f0000000000000000000080bf8e836cbf30eec33ec18d87320000000000000000000080bf0000803f0000000000000000000080bf77db54bf72390e3f46778a330000000000000000000080bf0000803f0000000000000000000080bf4a0535bf9a04353f26a4f2330000000000000000000080bf0000803f0000000000000000000080bf403a0ebfebda543f3069d6330000000000000000000080bf0000803f0000000000000000000080bffaefc3be2e836c3f6ff838340000000000000000000080bf0000803f0000000000000000000080bfacc747bea4147b3f5bdb50340000000000000000000080bf0000803f0000000000000000000080bf0000fab6ffff7f3ff95461340000000000000000000080bf0000803f0000000000000000000080bfdcc3473ed6147b3fc92569340000000000000000000080bf0000803f0000000000000000000080bf32eec33e8d836c3f806367340000000000000000000080bf0000803f0000000000000000000080bf73390e3f76db543f02c185340000000000000000000080bf0000803f0000000000000000000080bf9b04353f4905353fcc5845340000000000000000000080bf0000803f0000000000000000000080bfecda543f3f3a0e3f782435340000000000000000000080bf0000803f0000000000000000000080bf2e836c3ffcefc33e74841b340000000000000000000080bf0000803f0000000000000000000080bfa6147b3fa8c7473ea9e9f2330000000000000000000080bf0000803f0000000000000000000080bfd6147bbfd8c3473e8a54823300000000000000000000803f0000803f0000000000000000000080bf000080bf0000f8b66544103400000000000000000000803f0000803f0000000000000000000080bf0000803f0000f836654410b400000000000000000000803f0000803f0000000000000000000080bf8e836cbf30eec33eb865343300000000000000000000803f0000803f0000000000000000000080bf77db54bf72390e3f36baa63200000000000000000000803f0000803f0000000000000000000080bf4a0535bf9a04353f30b1d5b100000000000000000000803f0000803f0000000000000000000080bf403a0ebfebda543fc2cddc3200000000000000000000803f0000803f0000000000000000000080bffaefc3be2e836c3f38ba0cb300000000000000000000803f0000803f0000000000000000000080bfacc747bea4147b3f1c5e47b300000000000000000000803f0000803f0000000000000000000080bf0000fab6ffff7f3f44ce7cb300000000000000000000803f0000803f0000000000000000000080bfdcc3473ed6147b3faa4394b300000000000000000000803f0000803f0000000000000000000080bf32eec33e8d836c3fc732a3b300000000000000000000803f0000803f0000000000000000000080bf73390e3f76db543f5cb304b400000000000000000000803f0000803f0000000000000000000080bf9b04353f4905353fa867a5b300000000000000000000803f0000803f0000000000000000000080bfecda543f3f3a0e3f1822b6b300000000000000000000803f0000803f0000000000000000000080bf2e836c3ffcefc33e78f1bab300000000000000000000803f0000803f0000000000000000000080bfa6147b3fa8c7473e73a6b3b300000000000000000000803f0000803f0000000000000000000080bf
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.49999627, z: 0.000000057387872}
m_Extent: {x: 1, y: 0.5000037, z: 0.00000019174826}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ec79aa24b6bae5d42b0701bb81e3ced6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

167
Runtime/Meshes/Quad.asset Normal file
View File

@ -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: Quad
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 12
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.5, y: 0.5, z: 0.00000006755127}
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: 000001000200000002000300040005000600040006000700
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
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: 320
_typelessdata: 0000003f000000bfa48508b200000000000000000000803f000080bf0000000000000000000080bf0000003f0000003fa485083200000000000000000000803f000080bf0000000000000000000080bf000000bf0000003fa485083200000000000000000000803f000080bf0000000000000000000080bf000000bf000000bfa48508b200000000000000000000803f000080bf0000000000000000000080bf0000003f000000bfb41091b30000000000000000000080bf000080bf00000000000000000000803f000000bf000000bfb41091b30000000000000000000080bf000080bf00000000000000000000803f000000bf0000003fb41091330000000000000000000080bf000080bf00000000000000000000803f0000003f0000003fb41091330000000000000000000080bf000080bf00000000000000000000803f
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.00000006755127}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f0a87cd81a5904842bfbbcda9c35e91a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

167
Runtime/Meshes/Sphere.asset Normal file
View File

@ -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: Sphere
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 240
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 42
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.95105785, y: 1, z: 0.99999994}
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: 000001000200000002000300020001000400050001000000040001000600060001000500070000000300050000000800080000000700030002000900020004000a00090002000a000b00070003000c00030009000b0003000c000d00080007000d0007000b000e0009000a000c0009000e000f0005000800060005001000100005000f0011000f000800110008000d00120010000f0012000f00110013000b000c000d000b00140014000b001300150011000d0015000d00140013000c0016000c000e0016001700110015001200110017001500140018001800170015001400130019001900130016001400190018001a00100012001b00120017001b001a0012001c00170018001c001b001700180019001d001d001c001800190016001e001d0019001e0016000e001f001e0016001f001c0020001b0020001a001b001d0021001c001d001e002100210020001c001a00220010002200060010001f000e0023000e000a0023001e001f0024001e00240021001f002300240025001a002000250022001a002600060022002500260022000400060026000a000400270023000a002700270004002600210028002000210024002800280025002000230027002900290027002600230029002400240029002800280029002500290026002500
m_VertexData:
serializedVersion: 3
m_VertexCount: 42
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: 1680
_typelessdata: 3a9606bf4fc4593fa6ea8933389606bf50c4593f000000000000803f0000000000000000000080bf000000000000803f6921a233000000000000803f000000000000803f0000000000000000000080bfc05a26be7dc4593f5fffffbe1c5b26be6dc4593f83ffffbe0000803f0000000000000000000080bf2e2d30bfa796063f98ffffbe2e2d30bf8696063fd8ffffbe0000803f0000000000000000000080bfe5c3d93e79c4593fbc369ebe00c4d93e69c4593ff0369ebe0000803f0000000000000000000080bfc05a26be7bc4593f63ffff3e1d5b26be6dc4593f88ffff3e0000803f0000000000000000000080bfe5c3d93e79c4593fc0369e3effc3d93e69c4593ff5369e3e0000803f0000000000000000000080bf1ef964bf72f9e43ebc03113321f964bf61f9e43e000000000000803f0000000000000000000080bf2e2d30bfa596063f9affff3e2f2d30bf8496063fdaffff3e0000803f0000000000000000000080bfbb828dbe02fae43e25c459bfe3828dbed0f9e43e2cc459bf0000803f0000000000000000000080bfbe96863ebf96063f621b4fbfc296863e9996063f7b1b4fbf0000803f0000000000000000000080bf877873bfc866c832e7369ebe7a7873bf000000003d379ebe0000803f0000000000000000000080bf1e7916bf922a8333b81b4fbf237916bf00000000b51b4fbf0000803f0000000000000000000080bf877873bfc866c8b2e7369e3e7a7873bf000000003e379e3e0000803f0000000000000000000080bf000000006821a233ffff7fbf0000000000000000000080bf0000803f0000000000000000000080bfbb828dbefef9e43e27c4593fe3828dbecbf9e43e2cc4593f0000803f0000000000000000000080bfbe96863ebd96063f641b4f3fc496863e9596063f7c1b4f3f0000803f0000000000000000000080bf1e7916bf922a83b3b81b4f3f257916bf00000000b31b4f3f0000803f0000000000000000000080bf000000006821a2b3ffff7f3f00000000000000000000803f0000803f0000000000000000000080bf543e39bff4f9e4bef09506bf5b3e39bfa0f9e4be0a9606bf0000803f0000000000000000000080bf0fc459bfa19606bfc5792ab31fc459bf889606bf000000000000803f0000000000000000000080bf543e39bff6f9e4beee95063f5a3e39bfa6f9e4be0996063f0000803f0000000000000000000080bfbe9686bebd9606bf641b4fbfc59686be979606bf7e1b4fbf0000803f0000000000000000000080bfbe9686bebf9606bf621b4f3fc09686be999606bf7b1b4f3f0000803f0000000000000000000080bfe5c3d9be79c459bfbc369e3e00c4d9be69c459bff2369e3e0000803f0000000000000000000080bfe5c3d9be79c459bfc0369ebe01c4d9be69c459bff6369ebe0000803f0000000000000000000080bf1e79163f922a83b3b81b4f3f2479163f00000000b51b4f3f0000803f0000000000000000000080bfbb828d3e02fae4be25c4593fe1828d3ed0f9e4be2cc4593f0000803f0000000000000000000080bfc05a263e7ec459bf5fffff3e1b5b263e6dc459bf85ffff3e0000803f0000000000000000000080bf00000000000080bf6921a2b300000000000080bf000000000000803f0000000000000000000080bfc05a263e7cc459bf63ffffbe205b263e6cc459bf8bffffbe0000803f0000000000000000000080bfbb828d3efef9e4be27c459bfe1828d3ecbf9e4be2cc459bf0000803f0000000000000000000080bf2e2d303fa79606bf98ffff3e2e2d303f879606bfd8ffff3e0000803f0000000000000000000080bf3a96063f4fc459bfa6ea89b33996063f4fc459bf000000000000803f0000000000000000000080bf543e393ff4f9e43ef095063f5b3e393fa0f9e43e0a96063f0000803f0000000000000000000080bf1e79163f922a8333b81b4fbf2479163f00000000b31b4fbf0000803f0000000000000000000080bf2e2d303fa59606bf9affffbe2f2d303f849606bfd8ffffbe0000803f0000000000000000000080bf8778733fc866c8b2e7369e3e7a78733f000000003e379e3e0000803f0000000000000000000080bf0fc4593fa196063fc5792a331fc4593f8596063f000000000000803f0000000000000000000080bf543e393ff6f9e43eee9506bf5b3e393fa4f9e43e089606bf0000803f0000000000000000000080bf1ef9643f72f9e4bebc0311b321f9643f61f9e4be000000000000803f0000000000000000000080bf8778733fc866c832e7369ebe7a78733f000000003f379ebe0000803f0000000000000000000080bf
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.95105785, y: 1, z: 0.99999994}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 873de0939b7f76947a258a8897199a8e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: WireArc
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 64
topology: 3
baseVertex: 0
firstVertex: 0
vertexCount: 33
localAABB:
m_Center: {x: 0, y: 0.5, z: 0}
m_Extent: {x: 1, 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: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 0000010002000000030002000400030005000400060005000700060008000700090008000a0009000b000a000c000b000d000c000e000d000f000e0010000f001100100012001100130012001400130015001400160015001700160018001700190018001a0019001b001a001c001b001d001c001e001d001f001e0020001f00
m_VertexData:
serializedVersion: 3
m_VertexCount: 33
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: 396
_typelessdata: 72c47ebf23bdc83d00000000000080bf0000000000000000ba147bbfacc5473e0000000005fa74bf3ca0943e0000000066836cbf07efc33e0000000093c561bff35af13e0000000038db54bfd6390e3f00000000fce345bf9467223f00000000f70435bff704353f00000000946722bffce3453f00000000d6390ebf38db543f00000000f35af1be93c5613f0000000007efc3be66836c3f000000003ca094be05fa743f00000000acc547beba147b3f0000000023bdc8bd72c47e3f00000000000000000000803f0000000023bdc83d72c47e3f00000000acc5473eba147b3f000000003ca0943e05fa743f0000000007efc33e66836c3f00000000f35af13e93c5613f00000000d6390e3f38db543f000000009467223ffce3453f00000000f704353ff704353f00000000fce3453f9467223f0000000038db543fd6390e3f0000000093c5613ff35af13e0000000066836c3f07efc33e0000000005fa743f3ca0943e00000000ba147b3facc5473e0000000072c47e3f23bdc83d000000000000803f0000000000000000
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.5, z: 0}
m_Extent: {x: 1, 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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1854f56b8def82f47938a7ea45de39e0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: WireCircle
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 128
topology: 3
baseVertex: 0
firstVertex: 0
vertexCount: 64
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 0.9999999, z: 0.00000011920928}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 00000100000002000200030003000400040005000500060006000700070008000800090009000a000a000b000b000c000c000d000d000e000e000f000f00100010001100110012001200130013001400140015001500160016001700170018001800190019001a001a001b001b001c001c001d001d001e001e001f001f00200020002100210022002200230023002400240025002500260026002700270028002800290029002a002a002b002b002c002c002d002d002e002e002f002f00300030003100310032003200330033003400340035003500360036003700370038003800390039003a003a003b003b003c003c003d003d003e003e003f003f000100
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: 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: 1536
_typelessdata: 0000803f00000000000000000000000000000000000000006ec47e3f02bdc83d03bd48b20000000000000000000000006dc47e3f34bdc8bd35bd4832000000000000000000000000be147b3fc0c547bec1c5c7320000000000000000000000000bfa743f2fa094be30a014330000000000000000000000005e836c3f14efc3be15ef433300000000000000000000000097c5613fe85af1bee95a713300000000000000000000000031db543fd8390ebfd9398e3300000000000000000000000003e4453f986722bf9967a233000000000000000000000000f304353ff10435bff204b5330000000000000000000000009967223f01e445bf02e4c533000000000000000000000000d9390e3f30db54bf31dbd433000000000000000000000000e75af13e96c561bf97c5e13300000000000000000000000015efc33e5c836cbf5d83ec3300000000000000000000000030a0943e09fa74bf0afaf433000000000000000000000000bcc5473ebd147bbfbe14fb3300000000000000000000000035bdc83d6bc47ebf6cc4fe330000000000000000000000002ebd3bb3feff7fbfffffff3300000000000000000000000041bdc8bd6bc47ebf6cc4fe33000000000000000000000000c2c547bebc147bbfbd14fb3300000000000000000000000033a094be08fa74bf09faf43300000000000000000000000018efc3be5c836cbf5d83ec33000000000000000000000000ed5af1be95c561bf96c5e133000000000000000000000000dc390ebf2edb54bf2fdbd433000000000000000000000000996722bf02e445bf03e4c533000000000000000000000000f30435bff10435bff204b53300000000000000000000000004e445bf976722bf9867a23300000000000000000000000032db54bfd7390ebfd8398e3300000000000000000000000099c561bfe45af1bee55a713300000000000000000000000060836cbf0eefc3be0fef43330000000000000000000000000bfa74bf31a094be32a01433000000000000000000000000bf147bbfbfc547bec0c5c7320000000000000000000000006dc47ebf2ebdc8bd2fbd4832000000000000000000000000000080bf2cbdbb332dbd3ba80000000000000000000000006dc47ebf45bdc83d46bd48b2000000000000000000000000be147bbfcbc5473eccc5c7b20000000000000000000000000afa74bf36a0943e37a014b30000000000000000000000005e836cbf13efc33e14ef43b300000000000000000000000097c561bfe95af13eea5a71b300000000000000000000000030db54bfd9390e3fda398eb300000000000000000000000002e445bf9967223f9a67a2b3000000000000000000000000f10435bff304353ff404b5b30000000000000000000000009a6722bf01e4453f02e4c5b3000000000000000000000000d6390ebf32db543f33dbd4b3000000000000000000000000e85af1be96c5613f97c5e1b30000000000000000000000000befc3be5f836c3f6083ecb30000000000000000000000002da094be09fa743f0afaf4b3000000000000000000000000c6c547bebc147b3fbd14fbb30000000000000000000000001abdc8bd6bc47e3f6cc4feb30000000000000000000000002ede4c32feff7f3fffffffb30000000000000000000000005dbdc83d6bc47e3f6cc4feb3000000000000000000000000c8c5473ebc147b3fbd14fbb30000000000000000000000003da0943e07fa743f08faf4b30000000000000000000000001befc33e5b836c3f5c83ecb3000000000000000000000000e95af13e96c5613f97c5e1b3000000000000000000000000dd390e3f2ddb543f2edbd4b30000000000000000000000009a67223f01e4453f02e4c5b3000000000000000000000000f704353fed04353fee04b5b300000000000000000000000005e4453f9567223f9667a2b300000000000000000000000031db543fd9390e3fda398eb300000000000000000000000099c5613fe15af13ee25a71b30000000000000000000000005f836c3f13efc33e14ef43b30000000000000000000000000cfa743f26a0943e27a014b3000000000000000000000000bf147b3fbac5473ebbc5c7b2000000000000000000000000
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: 1, y: 0.9999999, z: 0.00000011920928}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e994291d266ec80419574a7d36415359
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: WireCube
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 3
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.5, 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: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000100020002000300030000000000040001000500020006000300070004000500050006000600070007000400
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
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: 96
_typelessdata: 000000bf000000bf000000bf0000003f000000bf000000bf0000003f000000bf0000003f000000bf000000bf0000003f000000bf0000003f000000bf0000003f0000003f000000bf0000003f0000003f0000003f000000bf0000003f0000003f
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.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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 51365e5b6ca1b8d438fe39907bcb22c3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: WireLine
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 2
topology: 3
baseVertex: 0
firstVertex: 0
vertexCount: 2
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 1}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 00000100
m_VertexData:
serializedVersion: 3
m_VertexCount: 2
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
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
m_DataSize: 48
_typelessdata: 000080bf000080bf000080bf0000000000000000000000000000803f0000803f0000803f000000000000000000000000
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: 1, y: 1, z: 1}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90a8d28d32c4d5843b8d25d1654ce32f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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: WireSphere
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 384
topology: 3
baseVertex: 0
firstVertex: 0
vertexCount: 192
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0.99999994}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 0
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 0000010002000300040005000000060002000700040008000600090007000a0008000b0009000c000a000d000b000e000c000f000d0010000e0011000f0012001000130011001400120015001300160014001700150018001600190017001a0018001b0019001c001a001d001b001e001c001f001d0020001e0021001f0022002000230021002400220025002300260024002700250028002600290027002a0028002b0029002c002a002d002b002e002c002f002d0030002e0031002f0032003000330031003400320035003300360034003700350038003600390037003a0038003b0039003c003a003d003b003e003c003f003d0040003e0041003f0042004000430041004400420045004300460044004700450048004600490047004a0048004b0049004c004a004d004b004e004c004f004d0050004e0051004f0052005000530051005400520055005300560054005700550058005600590057005a0058005b0059005c005a005d005b005e005c005f005d0060005e0061005f0062006000630061006400620065006300660064006700650068006600690067006a0068006b0069006c006a006d006b006e006c006f006d0070006e0071006f0072007000730071007400720075007300760074007700750078007600790077007a0078007b0079007c007a007d007b007e007c007f007d0080007e0081007f0082008000830081008400820085008300860084008700850088008600890087008a0088008b0089008c008a008d008b008e008c008f008d0090008e0091008f0092009000930091009400920095009300960094009700950098009600990097009a0098009b0099009c009a009d009b009e009c009f009d00a0009e00a1009f00a200a000a300a100a400a200a500a300a600a400a700a500a800a600a900a700aa00a800ab00a900ac00aa00ad00ab00ae00ac00af00ad00b000ae00b100af00b200b000b300b100b400b200b500b300b600b400b700b500b800b600b900b700ba00b800bb00b900bc00ba00bd00bb00be00bc00bf00bd000100be000300bf000500
m_VertexData:
serializedVersion: 3
m_VertexCount: 192
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: 2304
_typelessdata: 0000803f00000000000000006ec47e3f04bdc8bd000000000000803300000000ffff7fbf6ec47e3304bdc8bd6dc47ebf0000803f00000000000000006ec47e3f04bdc8b103bdc8bd6dc47e3f36bdc83d000000006dc47e3336bdc83d6cc47ebf6dc47e3f36bdc83135bdc83dbe147b3fc2c5473e00000000be147b33c2c5473ebd147bbfbe147b3fc2c54732c1c5473e0bfa743f31a0943e000000000bfa743331a0943e0afa74bf0bfa743f31a0943230a0943e5e836c3f16efc33e000000005e836c3316efc33e5d836cbf5e836c3f16efc33215efc33e97c5613fea5af13e0000000097c56133ea5af13e96c561bf97c5613fea5af132e95af13e31db543fda390e3f0000000031db5433da390e3f30db54bf31db543fda390e33d9390e3f03e4453f9a67223f0000000003e445339a67223f02e445bf03e4453f9a6722339967223ff304353ff304353f00000000f3043533f304353ff20435bff304353ff3043533f204353f9967223f03e4453f000000009967223303e4453f986722bf9967223f03e4453302e4453fd9390e3f32db543f00000000d9390e3332db543fd8390ebfd9390e3f32db543331db543fe75af13e98c5613f00000000e75af13298c5613fe65af1bee75af13e98c5613397c5613f15efc33e5e836c3f0000000015efc3325e836c3f14efc3be15efc33e5e836c335d836c3f30a0943e0bfa743f0000000030a094320bfa743f2fa094be30a0943e0bfa74330afa743fbcc5473ebf147b3f00000000bcc54732bf147b3fbbc547bebcc5473ebf147b33be147b3f35bdc83d6dc47e3f0000000035bdc8316dc47e3f34bdc8bd35bdc83d6dc47e336cc47e3f2ebd3bb30000803f000000002ebd3ba70000803f2dbd3b332ebd3bb300008033ffff7f3f41bdc8bd6dc47e3f0000000041bdc8b16dc47e3f40bdc83d41bdc8bd6dc47e336cc47e3fc2c547bebe147b3f00000000c2c547b2be147b3fc1c5473ec2c547bebe147b33bd147b3f33a094be0afa743f0000000033a094b20afa743f32a0943e33a094be0afa743309fa743f18efc3be5e836c3f0000000018efc3b25e836c3f17efc33e18efc3be5e836c335d836c3fed5af1be97c5613f00000000ed5af1b297c5613fec5af13eed5af1be97c5613396c5613fdc390ebf30db543f00000000dc390eb330db543fdb390e3fdc390ebf30db54332fdb543f996722bf04e4453f00000000996722b304e4453f9867223f996722bf04e4453303e4453ff30435bff304353f00000000f30435b3f304353ff204353ff30435bff3043533f204353f04e445bf9967223f0000000004e445b39967223f03e4453f04e445bf996722339867223f32db54bfd9390e3f0000000032db54b3d9390e3f31db543f32db54bfd9390e33d8390e3f99c561bfe65af13e0000000099c561b3e65af13e98c5613f99c561bfe65af132e55af13e60836cbf10efc33e0000000060836cb310efc33e5f836c3f60836cbf10efc3320fefc33e0bfa74bf33a0943e000000000bfa74b333a0943e0afa743f0bfa74bf33a0943232a0943ebf147bbfc1c5473e00000000bf147bb3c1c5473ebe147b3fbf147bbfc1c54732c0c5473e6dc47ebf30bdc83d000000006dc47eb330bdc83d6cc47e3f6dc47ebf30bdc8312fbdc83d000080bf2ebdbbb300000000000080b32ebdbbb3ffff7f3f000080bf2ebdbba72dbdbbb36dc47ebf47bdc8bd000000006dc47eb347bdc8bd6cc47e3f6dc47ebf47bdc8b146bdc8bdbe147bbfcdc547be00000000be147bb3cdc547bebd147b3fbe147bbfcdc547b2ccc547be0afa74bf38a094be000000000afa74b338a094be09fa743f0afa74bf38a094b237a094be5e836cbf15efc3be000000005e836cb315efc3be5d836c3f5e836cbf15efc3b214efc3be97c561bfeb5af1be0000000097c561b3eb5af1be96c5613f97c561bfeb5af1b2ea5af1be30db54bfdb390ebf0000000030db54b3db390ebf2fdb543f30db54bfdb390eb3da390ebf02e445bf9b6722bf0000000002e445b39b6722bf01e4453f02e445bf9b6722b39a6722bff10435bff50435bf00000000f10435b3f50435bff004353ff10435bff50435b3f40435bf9a6722bf03e445bf000000009a6722b303e445bf9967223f9a6722bf03e445b302e445bfd6390ebf34db54bf00000000d6390eb334db54bfd5390e3fd6390ebf34db54b333db54bfe85af1be98c561bf00000000e85af1b298c561bfe75af13ee85af1be98c561b397c561bf0befc3be61836cbf000000000befc3b261836cbf0aefc33e0befc3be61836cb360836cbf2da094be0bfa74bf000000002da094b20bfa74bf2ca0943e2da094be0bfa74b30afa74bfc6c547bebe147bbf00000000c6c547b2be147bbfc5c5473ec6c547bebe147bb3bd147bbf1abdc8bd6dc47ebf000000001abdc8b16dc47ebf19bdc83d1abdc8bd6dc47eb36cc47ebf2ede4c32000080bf000000002ede4c26000080bf2dde4cb22ede4c32000080b3ffff7fbf5dbdc83d6dc47ebf000000005dbdc8316dc47ebf5cbdc8bd5dbdc83d6dc47eb36cc47ebfc8c5473ebe147bbf00000000c8c54732be147bbfc7c547bec8c5473ebe147bb3bd147bbf3da0943e09fa74bf000000003da0943209fa74bf3ca094be3da0943e09fa74b308fa74bf1befc33e5d836cbf000000001befc3325d836cbf1aefc3be1befc33e5d836cb35c836cbfe95af13e98c561bf00000000e95af13298c561bfe85af1bee95af13e98c561b397c561bfdd390e3f2fdb54bf00000000dd390e332fdb54bfdc390ebfdd390e3f2fdb54b32edb54bf9a67223f03e445bf000000009a67223303e445bf996722bf9a67223f03e445b302e445bff704353fef0435bf00000000f7043533ef0435bff60435bff704353fef0435b3ee0435bf05e4453f976722bf0000000005e44533976722bf04e445bf05e4453f976722b3966722bf31db543fdb390ebf0000000031db5433db390ebf30db54bf31db543fdb390eb3da390ebf99c5613fe35af1be0000000099c56133e35af1be98c561bf99c5613fe35af1b2e25af1be5f836c3f15efc3be000000005f836c3315efc3be5e836cbf5f836c3f15efc3b214efc3be0cfa743f28a094be000000000cfa743328a094be0bfa74bf0cfa743f28a094b227a094bebf147b3fbcc547be00000000bf147b33bcc547bebe147bbfbf147b3fbcc547b2bbc547be
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: 1, y: 1, z: 0.99999994}
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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 402dfb8e92b8fd54a91baaa8e99280b9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

8
Runtime/Resources.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a7a14ddea6ee20b41bdeee174c48dc25
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77248e86b544b3c49b4ed533ad33bd50
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,72 @@
Shader "DCFApixels/DebugX/Handles"
{
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 On
CGINCLUDE
#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;
half4 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;
}
ENDCG
Pass
{
ZTest LEqual
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color;
}
ENDCG
}
Pass
{
ZTest Greater
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color * half4(1, 1, 1, 0.1);
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 37036939f3d0a824c82a3f34093d4a42
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,84 @@
Shader "DCFApixels/DebugX/Handles Buillboard"
{
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 On
CGINCLUDE
#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;
half4 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);
float4 worldOrigin = mul(UNITY_MATRIX_M, float4(0, 0, 0, 1));
float4 viewOrigin = float4(UnityObjectToViewPos(float3(0, 0, 0)), 1);
float4 worldPos = mul(UNITY_MATRIX_M, v.vertex);
float4 viewPos = worldPos - worldOrigin + viewOrigin;
float4 clipsPos = mul(UNITY_MATRIX_P, viewPos);
o.vertex = clipsPos;
//o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color * UNITY_ACCESS_INSTANCED_PROP(Props, _Color) * _DebugX_GlobalColor;
return o;
}
ENDCG
Pass
{
ZTest LEqual
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color;
}
ENDCG
}
Pass
{
ZTest Greater
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color * half4(1, 1, 1, 0.1);
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0fe57c76c30f7274f9ebb46c87d64036
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,105 @@
Shader "DCFApixels/DebugX/Handles Dot"
{
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 On
CGINCLUDE
#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;
half4 color : COLOR;
};
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
UNITY_INSTANCING_BUFFER_END(Props)
float _DebugX_GlobalDotSize;
float4 _DebugX_GlobalColor;
float GetHandleSize(float3 objectPosition)
{
float3 viewDir = normalize(_WorldSpaceCameraPos - objectPosition);
float distance = length(_WorldSpaceCameraPos - objectPosition);
float isOrthographic = UNITY_MATRIX_P[3][3];
distance = lerp(distance, 1, isOrthographic);
float fov = radians(UNITY_MATRIX_P[1][1] * 2.0);
float scale = distance * (1 / fov) * 0.015;
return scale * _DebugX_GlobalDotSize;
}
v2f vert (appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
float scaleMultiplier = GetHandleSize(mul(UNITY_MATRIX_M, float4(0, 0, 0, 1)).xyz);
float4x4 M = UNITY_MATRIX_M;
M._m00 *= scaleMultiplier;
M._m11 *= scaleMultiplier;
M._m22 *= scaleMultiplier;
float4 worldOrigin = mul(M, float4(0, 0, 0, 1));
float4 viewOrigin = float4(UnityObjectToViewPos(float3(0, 0, 0)), 1);
float4 worldPos = mul(M, v.vertex);
float4 viewPos = worldPos - worldOrigin + viewOrigin;
float4 clipsPos = mul(UNITY_MATRIX_P, viewPos);
o.vertex = clipsPos;
//o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color * UNITY_ACCESS_INSTANCED_PROP(Props, _Color) * _DebugX_GlobalColor;
return o;
}
ENDCG
Pass
{
ZTest LEqual
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color;
}
ENDCG
}
Pass
{
ZTest Greater
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color * half4(1, 1, 1, 0.1);
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 69efe102f685e6c4cb2e2f25b7f7bdc7
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,84 @@
Shader "DCFApixels/DebugX/Handles Lit"
{
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 On
CGINCLUDE
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
struct appdata_t
{
float3 vertex : POSITION;
float3 normal : NORMAL;
float4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
half4 color : COLOR0;
};
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);
float4 icolor = UNITY_ACCESS_INSTANCED_PROP(Props, _Color);
if (icolor.a >= 0)
{
v.color = v.color * icolor;
}
float3 eyeNormal = normalize (mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal).xyz);
float nl = saturate(eyeNormal.z);
float lighting = 0.333 + nl * 0.667 * 0.5;
float4 color;
color.rgb = lighting * v.color.rgb;
color.a = v.color.a;
o.color = saturate(color) * _DebugX_GlobalColor;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
ENDCG
Pass
{
ZTest LEqual
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color;
}
ENDCG
}
Pass
{
ZTest Greater
CGPROGRAM
half4 frag (v2f i) : SV_Target
{
return i.color * half4(1, 1, 1, 0.2);
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b3126f69d0ed1ac439449358fc8a54aa
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,101 @@
Shader "DCFApixels/DebugX/Handles Wire"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
}
SubShader
{
Tags { "ForceSupported" = "True" "Queue" = "Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off Cull Off Fog { Mode Off }
Offset -1, -1
Lighting Off
ZTest Off
CGINCLUDE
#pragma vertex vert
#pragma geometry geom
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2g
{
float4 vertex : POSITION;
float4 color : COLOR;
};
struct g2f
{
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;
v2g vert(appdata v)
{
v2g 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;
}
[maxvertexcount(6)]
void geom(triangle v2g input[3], inout LineStream<g2f> lineStream)
{
g2f o;
for (int i = 0; i < 3; i++)
{
o.vertex = input[i].vertex;
o.color = input[i].color;
lineStream.Append(o);
int next = (i + 1) % 3;
o.vertex = input[next].vertex;
o.color = input[next].color;
lineStream.Append(o);
lineStream.RestartStrip();
}
}
ENDCG
Pass
{
ZTest LEqual
CGPROGRAM
half4 frag (g2f i) : SV_Target
{
return i.color;
}
ENDCG
}
Pass
{
ZTest Greater
CGPROGRAM
half4 frag (g2f i) : SV_Target
{
return i.color * half4(1, 1, 1, 0.05);
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 44b75ed8f4e1d21469ab056c86b4c1a1
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 34d725f5b5bb8244385ed6769d4baaf7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Runtime/Utils.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0fcff951551e3b945976d994abe83a98
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,108 @@
using DCFApixels.DebugXCore.Internal;
using UnityEngine;
using UnityEngine.Rendering;
namespace DCFApixels
{
public static partial class DebugX
{
public static T LoadMeshesList<T>(T list, string path)
{
return MeshesListLoader.Load(list, path);
}
public static MeshesList Meshes;
public readonly struct MeshesList
{
public readonly Mesh Arrow;
public readonly Mesh Cube;
public readonly Mesh Quad;
public readonly Mesh Circle; // Circle_1
public readonly Mesh Sphere; // Sphere_0
public readonly Mesh CapsuleBody;
public readonly Mesh CapsuleHead;
public readonly Mesh FlatCapsuleBody;
public readonly Mesh FlatCapsuleHead;
public readonly Mesh Dot;
public readonly Mesh DotQuad;
public readonly Mesh DotCross;
public readonly Mesh DotDiamond;
public readonly Mesh WireLine;
public readonly Mesh WireCube;
public readonly Mesh WireArc;
public readonly Mesh WireCircle;
public readonly Mesh WireSphere;
}
private static Material CreateMaterial(string name)
{
Material result = new Material(Shader.Find(name));
result.SetColor(ColorPropertyID, Color.white);
result.renderQueue = (int)RenderQueue.Transparent;
result.enableInstancing = true;
return result;
}
public static class Materials
{
private static Material _lit;
private static Material _unlit;
private static Material _wire;
private static Material _billboard;
private static Material _dot;
private static void Init()
{
if (_lit != null) { return; }
_lit = CreateMaterial("DCFApixels/DebugX/Handles Lit");
_unlit = CreateMaterial("DCFApixels/DebugX/Handles");
_wire = CreateMaterial("DCFApixels/DebugX/Handles Wire");
_billboard = CreateMaterial("DCFApixels/DebugX/Handles Buillboard");
_dot = CreateMaterial("DCFApixels/DebugX/Handles Dot");
}
public static Material Lit
{
get
{
Init();
return _lit;
}
}
public static Material Unlit
{
get
{
Init();
return _unlit;
}
}
public static Material Wire
{
get
{
Init();
return _wire;
}
}
public static Material Billboard
{
get
{
Init();
return _billboard;
}
}
public static Material Dot
{
get
{
Init();
return _dot;
}
}
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c7f4fd740be0c084baef28deea20d28c

View File

@ -0,0 +1,412 @@
#undef DEBUG
#if DEBUG
#define DEV_MODE
#endif
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using System;
using Unity.Collections.LowLevel.Unsafe;
using System.Buffers;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace DCFApixels
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
public static unsafe partial class DebugX
{
#region Utils Methods
private static string GetGenericTypeName_Internal(Type type, int maxDepth, bool isFull)
{
#if (DEBUG && !DISABLE_DEBUG) || !REFLECTION_DISABLED //â äåáàæíûõ óòèëèòàõ REFLECTION_DISABLED òîëüêî â ðåëèçíîì áèëäå ðàáîòàåò
string typeName = isFull ? type.FullName : type.Name;
if (!type.IsGenericType || maxDepth == 0)
{
return typeName;
}
int genericInfoIndex = typeName.LastIndexOf('`');
if (genericInfoIndex > 0)
{
typeName = typeName.Remove(genericInfoIndex);
}
string genericParams = "";
Type[] typeParameters = type.GetGenericArguments();
for (int i = 0; i < typeParameters.Length; ++i)
{
//÷òîáû ñòðîêà íå áûëà ñëèøêîì äëèííîé, èñïîëüçóþòñÿ ñîêðàùåííûå èìåíà äëÿ òèïîâ àðãóìåíòîâ
string paramTypeName = GetGenericTypeName_Internal(typeParameters[i], maxDepth - 1, false);
genericParams += (i == 0 ? paramTypeName : $", {paramTypeName}");
}
return $"{typeName}<{genericParams}>";
#else
Debug.LogWarning($"Reflection is not available, the {nameof(GetGenericTypeName_Internal)} method does not work.");
return isFull ? type.FullName : type.Name;
#endif
}
[IN(LINE)]
public static float FastMagnitude(Vector3 v)
{
return FastSqrt(v.x * v.x + v.y * v.y + v.z * v.z);
}
[IN(LINE)]
private static unsafe float FastSqrt(float number)
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = *(long*)&y; // evil floating point bit level hacking
i = 0x5f3759df - (i >> 1); // what the fuck?
y = *(float*)&i;
y = y * (threehalfs - (x2 * y * y)); // 1st iteration
//y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return 1 / y;
}
[IN(LINE)]
private static int NextPow2(int v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
return ++v;
}
private static Color[] _setColorBuffer = new Color[64];
[IN(LINE)]
static void AddColorsToMesh(Mesh mesh, Color color)
{
int vertexCount = mesh.vertexCount;
if (_setColorBuffer.Length < vertexCount)
{
_setColorBuffer = new Color[NextPow2(vertexCount)];
}
for (int i = 0; i < mesh.vertexCount; i++)
{
_setColorBuffer[i] = color;
}
mesh.SetColors(_setColorBuffer, 0, vertexCount);
}
[IN(LINE)]
private static bool IsGizmosRender()
{
bool result = true;
#if UNITY_EDITOR
result = Handles.ShouldRenderGizmos();
#endif
return result;
}
#endregion
#region private StructList
private interface IStructListElement<T>
{
void OnSwap(ref T element);
}
private struct StructList
{
internal Array _items;
internal int _count;
internal readonly bool _isUseArrayPool;
private StructList(Array items, int count, bool isUseArrayPool)
{
_items = items;
_count = count;
_isUseArrayPool = isUseArrayPool;
}
public static StructList ConvertFrom<T>(StructList<T> list)
{
return new StructList(list._items, list._count, list._isUseArrayPool);
}
}
[System.Diagnostics.DebuggerDisplay("Count: {Count}")]
private struct StructList<T> : IDisposable
{
//private struct Dummy : IStructListElement<T>
//{
// public void OnSwap(ref T element) { }
//}
//private static IStructListElement<T> _internal = default(T) as IStructListElement<T> ?? default(Dummy);
internal T[] _items;
internal int _count;
internal readonly bool _isUseArrayPool;
private static readonly bool _isUnmanaged = UnsafeUtility.IsUnmanaged<T>();
public bool IsCreated
{
[IN(LINE)]
get { return _items != null; }
}
public int Count
{
[IN(LINE)]
get { return _count; }
}
public int Capacity
{
[IN(LINE)]
get { return _items.Length; }
set
{
UpSize(value);
}
}
public T this[int index]
{
[IN(LINE)]
get
{
#if DEV_MODE
if (index < 0 || index >= _count) { new ArgumentOutOfRangeException(); }
#endif
return _items[index];
}
[IN(LINE)]
set
{
#if DEV_MODE
if (index < 0 || index >= _count) { new ArgumentOutOfRangeException(); }
#endif
_items[index] = value;
}
}
[IN(LINE)]
public StructList(int minCapacity, bool useArrayPool = false)
{
minCapacity = NextPow2(minCapacity);
if (useArrayPool)
{
_items = ArrayPool<T>.Shared.Rent(minCapacity);
}
else
{
_items = new T[minCapacity];
}
_count = 0;
_isUseArrayPool = useArrayPool;
}
private StructList(StructList list)
{
_items = (T[])list._items;
_count = list._count;
_isUseArrayPool = list._isUseArrayPool;
}
[IN(LINE)]
public void Add(T item)
{
UpSize(_count + 1);
//_internal.OnSwap(ref item);
_items[_count++] = item;
}
[IN(LINE)]
public void AddRange(ReadOnlySpan<T> items)
{
UpSize(_count + items.Length);
for (int i = 0; i < items.Length; i++)
{
//_internal.OnSwap(ref item);
_items[_count++] = items[i];
}
}
public void UpSize(int newMinSize)
{
if (newMinSize <= _items.Length) { return; }
newMinSize = NextPow2(newMinSize);
if (newMinSize <= _items.Length) { return; }
if (_isUseArrayPool)
{
var newItems = ArrayPool<T>.Shared.Rent(newMinSize);
for (int i = 0, iMax = _count; i < iMax; i++)
{
newItems[i] = _items[i];
}
ArrayPool<T>.Shared.Return(_items, !_isUnmanaged);
_items = newItems;
}
else
{
Array.Resize(ref _items, newMinSize);
}
}
[IN(LINE)]
public int IndexOf(T item)
{
return Array.IndexOf(_items, item, 0, _count);
}
[IN(LINE)]
public void SwapAt(int idnex1, int idnex2)
{
T tmp = _items[idnex1];
_items[idnex1] = _items[idnex2];
_items[idnex2] = tmp;
//_internal.OnSwap(ref _items[idnex1]);
//_internal.OnSwap(ref _items[idnex2]);
}
[IN(LINE)]
public void FastRemoveAt(int index)
{
#if DEV_MODE
if (index < 0 || index >= _count) { new ArgumentOutOfRangeException(); }
#endif
_items[index] = _items[--_count];
//_internal.OnSwap(ref _items[index]);
}
[IN(LINE)]
public void RemoveAt(int index)
{
#if DEV_MODE
if (index < 0 || index >= _count) { new ArgumentOutOfRangeException(); }
#endif
_items[index] = _items[--_count];
//_internal.OnSwap(ref _items[index]);
_items[_count] = default;
}
[IN(LINE)]
public void RemoveAtWithOrder(int index)
{
#if DEV_MODE
if (index < 0 || index >= _count) { new ArgumentOutOfRangeException(); }
#endif
for (int i = index; i < _count; i++)
{
_items[i] = _items[i + 1];
//_internal.OnSwap(ref _items[i]);
}
}
[IN(LINE)]
public bool Remove(T item)
{
int index = IndexOf(item);
if (index >= 0)
{
RemoveAt(index);
return true;
}
return false;
}
[IN(LINE)]
public bool RemoveWithOrder(T item)
{
int index = IndexOf(item);
if (index >= 0)
{
RemoveAtWithOrder(index);
return true;
}
return false;
}
[IN(LINE)]
public void FastClear()
{
_count = 0;
}
[IN(LINE)]
public void Clear()
{
for (int i = 0; i < _count; i++)
{
_items[i] = default;
}
_count = 0;
}
[IN(LINE)]
public ReadOnlySpan<T>.Enumerator GetEnumerator()
{
return new ReadOnlySpan<T>(_items, 0, _count).GetEnumerator();
}
[IN(LINE)]
public Span<T> AsSpan()
{
return new Span<T>(_items, 0, _count);
}
[IN(LINE)]
public ReadOnlySpan<T> AsReadOnlySpan()
{
return new ReadOnlySpan<T>(_items, 0, _count);
}
[IN(LINE)]
public IEnumerable<T> ToEnumerable()
{
return _items.Take(_count);
}
[IN(LINE)]
private static int NextPow2(int v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
return ++v;
}
public void Dispose()
{
if (_isUseArrayPool)
{
ArrayPool<T>.Shared.Return(_items);
}
_items = null;
_count = 0;
}
public static implicit operator StructList(StructList<T> a) => StructList.ConvertFrom(a);
public static explicit operator StructList<T>(StructList a) => new StructList<T>(a);
}
#endregion
#region private PinnedArray
private static class DummyArray<T>
{
private readonly static T[] _array = new T[2];
public static T[] Get()
{
return _array;
}
}
private readonly struct PinnedArray<T> : IDisposable where T : unmanaged
{
public readonly T[] Array;
public readonly T* Ptr;
public readonly ulong Handle;
public PinnedArray(T[] array, T* ptr, ulong handle)
{
Array = array;
Ptr = ptr;
Handle = handle;
}
public static PinnedArray<T> Pin(T[] array)
{
return new PinnedArray<T>(array, (T*)UnsafeUtility.PinGCArrayAndGetDataAddress(array, out ulong handle), handle);
}
public void Dispose()
{
if (Ptr != null)
{
UnsafeUtility.ReleaseGCObject(Handle);
}
}
public PinnedArray<U> As<U>() where U : unmanaged
{
T[] array = Array;
U[] newArray = UnsafeUtility.As<T[], U[]>(ref array);
return new PinnedArray<U>(newArray, (U*)Ptr, Handle);
}
}
#endregion
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 23c5d9ebb6ab86c4599c0979a6adaf22

View File

@ -0,0 +1,90 @@
#undef DEBUG
#if DEBUG
#define DEV_MODE
#endif
using System;
using System.Diagnostics;
using Unity.Collections.LowLevel.Unsafe;
using static DCFApixels.DebugX;
namespace DCFApixels.DebugXCore
{
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
[DebuggerDisplay("Count:{Count}")]
public readonly ref struct GizmosList
{
public readonly Array Items;
public readonly int Count;
public GizmosList(Array items, int count)
{
Items = items;
Count = count;
}
public static GizmosList ConvertFrom<T>(GizmosList<T> list)
{
return new GizmosList(list.Items, list.Count);
}
public GizmosList<T> As<T>()
{
var items = Items;
return new GizmosList<T>(UnsafeUtility.As<Array, Gizmo<T>[]>(ref items), Count);
}
internal static GizmosList<T> From<T>(GizmoInternal<T>[] items, int count) where T : IGizmo<T>
{
return new GizmosList<T>(UnsafeUtility.As<GizmoInternal<T>[], Gizmo<T>[]>(ref items), count);
}
}
[DebuggerDisplay("Count:{Count}")]
public readonly ref struct GizmosList<T>
{
public readonly Gizmo<T>[] Items;
public readonly int Count;
[IN(LINE)]
public GizmosList(Gizmo<T>[] items, int count)
{
Items = items;
Count = count;
}
[IN(LINE)]
public GizmosList(GizmosList list)
{
Items = (Gizmo<T>[])list.Items;
Count = list.Count;
}
public ref Gizmo<T> this[int index]
{
[IN(LINE)]
get { return ref Items[index]; }
}
public GizmosList<TOther> As<TOther>()
{
var items = Items;
return new GizmosList<TOther>(UnsafeUtility.As<Gizmo<T>[], Gizmo<TOther>[]>(ref items), Count);
}
[IN(LINE)] public Enumerator GetEnumerator() { return new Enumerator(Items, Count); }
public struct Enumerator
{
public readonly Gizmo<T>[] Items;
public readonly int Count;
private int _index;
[IN(LINE)]
public Enumerator(Gizmo<T>[] items, int count)
{
Items = items;
Count = count;
_index = -1;
}
public ref Gizmo<T> Current
{
[IN(LINE)]
get => ref Items[_index];
}
[IN(LINE)] public bool MoveNext() { return ++_index < Count; }
}
public static implicit operator GizmosList(GizmosList<T> a) => GizmosList.ConvertFrom(a);
public static explicit operator GizmosList<T>(GizmosList a) => new GizmosList<T>(a);
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 434ffd7a96114134094bc2f4b7a6f465

50
Runtime/Utils/IGizmo.cs Normal file
View File

@ -0,0 +1,50 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
namespace DCFApixels.DebugXCore
{
public interface IGizmo<T> where T : IGizmo<T>
{
IGizmoRenderer<T> RegisterNewRenderer();
}
public interface IGizmoRenderer<T> where T : IGizmo<T>
{
int ExecuteOrder { get; }
//Статик рендер означает что в рамках одного контекста для всех камер используется одинаковый набор команд в CommandBuffer
//Поэтому Prepare и Render можно вызвать один раз, а не по разу на каждую камеру
bool IsStaticRender { get; }
void Prepare(Camera camera, GizmosList<T> list);
void Render(Camera camera, GizmosList<T> list, CommandBuffer cb);
}
public interface IGizmoRenderer_UnityGizmos<T> : IGizmoRenderer<T> where T : IGizmo<T>
{
void Render_UnityGizmos(Camera camera, GizmosList<T> list);
}
public readonly struct RenderContext : IEquatable<RenderContext>
{
public readonly Camera Camera;
public bool IsStatic
{
get { return Camera == null || Camera.name == "SceneCamera"; }
}
public RenderContext(Camera camera)
{
Camera = camera;
}
public bool Equals(RenderContext other)
{
return Camera == other.Camera;
}
public override bool Equals(object obj)
{
return obj is RenderContext && Equals((RenderContext)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(Camera);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1416e51cb5495ce438d4b06930f2b51c

Some files were not shown because too many files have changed in this diff Show More