update sample

This commit is contained in:
DCFApixels 2025-03-05 15:42:27 +08:00
parent bdf4e22ead
commit ecb40e4fb9
2 changed files with 221 additions and 80 deletions

View File

@ -1642,8 +1642,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 298618459}
serializedVersion: 2
m_LocalRotation: {x: 0.374766, y: 0.10948002, z: -0.044618975, w: 0.91955084}
m_LocalPosition: {x: -6.55, y: 12.125551, z: -13.9}
m_LocalRotation: {x: 0.37600642, y: 0.112164184, z: -0.045908842, w: 0.91865706}
m_LocalPosition: {x: -6.923626, y: 12.125552, z: -13.809754}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@ -5224,38 +5224,107 @@ MonoBehaviour:
m_EditorClassIdentifier:
Color: {r: 0, g: 1, b: 0.8273995, a: 1}
Points:
- {fileID: 1835935953}
- {fileID: 110576945}
- {fileID: 355061454}
- {fileID: 182645324}
- {fileID: 791185246}
- {fileID: 1091192061}
- {fileID: 1952280884}
- {fileID: 571535357}
- {fileID: 1328819992}
- {fileID: 1684676878}
- {fileID: 1838637453}
- {fileID: 571078686}
- {fileID: 1548679009}
- {fileID: 1320741259}
- {fileID: 1118944269}
- {fileID: 1092085210}
- {fileID: 1115296735}
- {fileID: 541431817}
- {fileID: 214039700}
- {fileID: 1164493001}
- {fileID: 189604381}
- {fileID: 499527135}
- {fileID: 1665483939}
- {fileID: 527048758}
- {fileID: 13814252}
- {fileID: 289269789}
- {fileID: 1391838415}
- {fileID: 660016667}
- {fileID: 13776270}
- {fileID: 1453499682}
- {fileID: 81666344}
- {fileID: 1986672917}
- {x: -13, y: 3, z: 7}
- {x: -12.8, y: 3.194709, z: 7}
- {x: -12.6, y: 3.358678, z: 7}
- {x: -12.4, y: 3.4660196, z: 7}
- {x: -12.2, y: 3.4997869, z: 7}
- {x: -12, y: 3.4546487, z: 7}
- {x: -11.8, y: 3.3377316, z: 7}
- {x: -11.6, y: 3.167494, z: 7}
- {x: -11.4, y: 2.9708128, z: 7}
- {x: -11.2, y: 2.7787397, z: 7}
- {x: -11, y: 2.6215987, z: 7}
- {x: -10.8, y: 2.524199, z: 7}
- {x: -10.6, y: 2.5019176, z: 7}
- {x: -10.4, y: 2.5582728, z: 7}
- {x: -10.2, y: 2.6843667, z: 7}
- {x: -10, y: 2.8602922, z: 7}
- {x: -9.8, y: 3.0582747, z: 7}
- {x: -9.6, y: 3.2470567, z: 7}
- {x: -9.4, y: 3.396834, z: 7}
- {x: -9.2, y: 3.48396, z: 7}
- {x: -9, y: 3.4946792, z: 7}
- {x: -8.799999, y: 3.4272993, z: 7}
- {x: -8.6, y: 3.2924585, z: 7}
- {x: -8.4, y: 3.111445, z: 7}
- {x: -8.2, y: 2.9128363, z: 7}
- {x: -8, y: 2.7279894, z: 7}
- {x: -7.7999997, y: 2.5860865, z: 7}
- {x: -7.6, y: 2.509532, z: 7}
- {x: -7.4, y: 2.510411, z: 7}
- {x: -7.2, y: 2.5885859, z: 7}
- {x: -7, y: 2.7317135, z: 7}
- {x: -6.7999997, y: 2.9171982, z: 7}
- {x: -6.6, y: 3.115755, z: 7}
- {x: -6.4, y: 3.2960367, z: 7}
- {x: -6.2, y: 3.429581, z: 7}
- {x: -6, y: 3.4953036, z: 7}
- {x: -5.7999997, y: 3.4828289, z: 7}
- {x: -5.6, y: 3.394126, z: 7}
- {x: -5.4, y: 3.2431993, z: 7}
- {x: -5.2, y: 3.0538766, z: 7}
- {x: -5, y: 2.8560483, z: 7}
- {x: -4.8, y: 2.6809468, z: 7}
- {x: -4.5999994, y: 2.5562162, z: 7}
- {x: -4.3999996, y: 2.50155, z: 7}
- {x: -4.2, y: 2.5255778, z: 7}
- {x: -4, y: 2.6245065, z: 7}
- {x: -3.8000002, y: 2.782717, z: 7}
- {x: -3.5999994, y: 2.9752328, z: 7}
- {x: -3.3999996, y: 3.1716578, z: 7}
- {x: -3.1999998, y: 3.340982, z: 7}
- {x: -3, y: 3.4564726, z: 7}
- {x: -2.8000002, y: 3.4998965, z: 7}
- {x: -2.5999994, y: 3.4643974, z: 7}
- {x: -2.3999996, y: 3.3555803, z: 7}
- {x: -2.1999998, y: 3.1906252, z: 7}
- {x: -2, y: 2.9955742, z: 7}
- {x: -1.8000002, y: 2.8012223, z: 7}
- {x: -1.5999994, y: 2.6382523, z: 7}
- {x: -1.3999996, y: 2.532395, z: 7}
- {x: -1.1999998, y: 2.500362, z: 7}
- {x: -1, y: 2.5472107, z: 7}
- {x: -0.8000002, y: 2.665545, z: 7}
- {x: -0.5999994, y: 2.836683, z: 7}
- {x: -0.39999962, y: 3.0336044, z: 7}
- {x: -0.19999981, y: 3.2252204, z: 7}
- {x: 0, y: 3.3812792, z: 7}
- {x: 0.19999981, y: 3.4771426, z: 7}
- {x: 0.40000057, y: 3.4976754, z: 7}
- {x: 0.6000004, y: 3.4396362, z: 7}
- {x: 0.8000002, y: 3.3121884, z: 7}
- {x: 1, y: 3.135453, z: 7}
- {x: 1.1999998, y: 2.9373324, z: 7}
- {x: 1.4000006, y: 2.749105, z: 7}
- {x: 1.6000004, y: 2.6004891, z: 7}
- {x: 1.8000002, y: 2.5149472, z: 7}
- {x: 2, y: 2.5059843, z: 7}
- {x: 2.1999998, y: 2.5750153, z: 7}
- {x: 2.4000006, y: 2.711143, z: 7}
- {x: 2.6000004, y: 2.892874, z: 7}
- {x: 2.8000002, y: 3.0915182, z: 7}
- {x: 3, y: 3.2757134, z: 7}
- {x: 3.2000008, y: 3.4163802, z: 7}
- {x: 3.3999996, y: 3.491309, z: 7}
- {x: 3.6000004, y: 3.4886713, z: 7}
- {x: 3.8000011, y: 3.4088824, z: 7}
- {x: 4, y: 3.2645414, z: 7}
- {x: 4.200001, y: 3.0784335, z: 7}
- {x: 4.3999996, y: 2.8799446, z: 7}
- {x: 4.6000004, y: 2.700408, z: 7}
- {x: 4.800001, y: 2.5681708, z: 7}
- {x: 5, y: 2.5041106, z: 7}
- {x: 5.200001, y: 2.51834, z: 7}
- {x: 5.3999996, y: 2.6086125, z: 7}
- {x: 5.6000004, y: 2.7606773, z: 7}
- {x: 5.800001, y: 2.9505262, z: 7}
- {x: 6, y: 3.1481843, z: 7}
- {x: 6.200001, y: 3.322449, z: 7}
- {x: 6.3999996, y: 3.4458048, z: 7}
- {x: 6.6000004, y: 3.4987788, z: 7}
- {x: 6.800001, y: 3.473006, z: 7}
Frequency: 2
IsStrip: 1
--- !u!4 &1388354758
Transform:
@ -5266,8 +5335,8 @@ Transform:
m_GameObject: {fileID: 1388354756}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: -3, y: 3, z: 7}
m_LocalScale: {x: 20, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1835935953}
@ -6888,38 +6957,107 @@ MonoBehaviour:
m_EditorClassIdentifier:
Color: {r: 0, g: 1, b: 0.8273995, a: 1}
Points:
- {fileID: 289600336}
- {fileID: 1653109800}
- {fileID: 992714425}
- {fileID: 1526492868}
- {fileID: 476965516}
- {fileID: 1912963054}
- {fileID: 697898490}
- {fileID: 1569941638}
- {fileID: 279954748}
- {fileID: 1162072208}
- {fileID: 364652631}
- {fileID: 1514333798}
- {fileID: 303621177}
- {fileID: 1690733884}
- {fileID: 1204882448}
- {fileID: 1535275533}
- {fileID: 1698856279}
- {fileID: 2048603620}
- {fileID: 1398403786}
- {fileID: 181830928}
- {fileID: 1384757752}
- {fileID: 1302109928}
- {fileID: 1137922221}
- {fileID: 588214553}
- {fileID: 1340738584}
- {fileID: 1266202423}
- {fileID: 2004019677}
- {fileID: 1679889696}
- {fileID: 196211947}
- {fileID: 394622563}
- {fileID: 721881336}
- {fileID: 1879310237}
- {x: -13, y: 2.5, z: 7}
- {x: -12.8, y: 2.694709, z: 7}
- {x: -12.6, y: 2.858678, z: 7}
- {x: -12.4, y: 2.9660196, z: 7}
- {x: -12.2, y: 2.9997869, z: 7}
- {x: -12, y: 2.9546487, z: 7}
- {x: -11.8, y: 2.8377316, z: 7}
- {x: -11.6, y: 2.667494, z: 7}
- {x: -11.4, y: 2.4708128, z: 7}
- {x: -11.2, y: 2.2787397, z: 7}
- {x: -11, y: 2.1215987, z: 7}
- {x: -10.8, y: 2.024199, z: 7}
- {x: -10.6, y: 2.0019176, z: 7}
- {x: -10.4, y: 2.0582728, z: 7}
- {x: -10.2, y: 2.1843667, z: 7}
- {x: -10, y: 2.3602922, z: 7}
- {x: -9.8, y: 2.5582747, z: 7}
- {x: -9.6, y: 2.7470567, z: 7}
- {x: -9.4, y: 2.896834, z: 7}
- {x: -9.2, y: 2.98396, z: 7}
- {x: -9, y: 2.9946792, z: 7}
- {x: -8.799999, y: 2.9272993, z: 7}
- {x: -8.6, y: 2.7924585, z: 7}
- {x: -8.4, y: 2.611445, z: 7}
- {x: -8.2, y: 2.4128363, z: 7}
- {x: -8, y: 2.2279894, z: 7}
- {x: -7.7999997, y: 2.0860865, z: 7}
- {x: -7.6, y: 2.009532, z: 7}
- {x: -7.4, y: 2.010411, z: 7}
- {x: -7.2, y: 2.0885859, z: 7}
- {x: -7, y: 2.2317135, z: 7}
- {x: -6.7999997, y: 2.4171982, z: 7}
- {x: -6.6, y: 2.615755, z: 7}
- {x: -6.4, y: 2.7960367, z: 7}
- {x: -6.2, y: 2.929581, z: 7}
- {x: -6, y: 2.9953036, z: 7}
- {x: -5.7999997, y: 2.9828289, z: 7}
- {x: -5.6, y: 2.894126, z: 7}
- {x: -5.4, y: 2.7431993, z: 7}
- {x: -5.2, y: 2.5538766, z: 7}
- {x: -5, y: 2.3560483, z: 7}
- {x: -4.8, y: 2.1809468, z: 7}
- {x: -4.5999994, y: 2.0562162, z: 7}
- {x: -4.3999996, y: 2.00155, z: 7}
- {x: -4.2, y: 2.0255778, z: 7}
- {x: -4, y: 2.1245065, z: 7}
- {x: -3.8000002, y: 2.282717, z: 7}
- {x: -3.5999994, y: 2.4752328, z: 7}
- {x: -3.3999996, y: 2.6716578, z: 7}
- {x: -3.1999998, y: 2.840982, z: 7}
- {x: -3, y: 2.9564726, z: 7}
- {x: -2.8000002, y: 2.9998965, z: 7}
- {x: -2.5999994, y: 2.9643974, z: 7}
- {x: -2.3999996, y: 2.8555803, z: 7}
- {x: -2.1999998, y: 2.6906252, z: 7}
- {x: -2, y: 2.4955742, z: 7}
- {x: -1.8000002, y: 2.3012223, z: 7}
- {x: -1.5999994, y: 2.1382523, z: 7}
- {x: -1.3999996, y: 2.032395, z: 7}
- {x: -1.1999998, y: 2.000362, z: 7}
- {x: -1, y: 2.0472107, z: 7}
- {x: -0.8000002, y: 2.165545, z: 7}
- {x: -0.5999994, y: 2.336683, z: 7}
- {x: -0.39999962, y: 2.5336044, z: 7}
- {x: -0.19999981, y: 2.7252204, z: 7}
- {x: 0, y: 2.8812792, z: 7}
- {x: 0.19999981, y: 2.9771426, z: 7}
- {x: 0.40000057, y: 2.9976754, z: 7}
- {x: 0.6000004, y: 2.9396362, z: 7}
- {x: 0.8000002, y: 2.8121884, z: 7}
- {x: 1, y: 2.635453, z: 7}
- {x: 1.1999998, y: 2.4373324, z: 7}
- {x: 1.4000006, y: 2.249105, z: 7}
- {x: 1.6000004, y: 2.1004891, z: 7}
- {x: 1.8000002, y: 2.0149472, z: 7}
- {x: 2, y: 2.0059843, z: 7}
- {x: 2.1999998, y: 2.0750153, z: 7}
- {x: 2.4000006, y: 2.211143, z: 7}
- {x: 2.6000004, y: 2.392874, z: 7}
- {x: 2.8000002, y: 2.5915182, z: 7}
- {x: 3, y: 2.7757134, z: 7}
- {x: 3.2000008, y: 2.9163802, z: 7}
- {x: 3.3999996, y: 2.991309, z: 7}
- {x: 3.6000004, y: 2.9886713, z: 7}
- {x: 3.8000011, y: 2.9088824, z: 7}
- {x: 4, y: 2.7645414, z: 7}
- {x: 4.200001, y: 2.5784335, z: 7}
- {x: 4.3999996, y: 2.3799446, z: 7}
- {x: 4.6000004, y: 2.200408, z: 7}
- {x: 4.800001, y: 2.0681708, z: 7}
- {x: 5, y: 2.0041106, z: 7}
- {x: 5.200001, y: 2.01834, z: 7}
- {x: 5.3999996, y: 2.1086125, z: 7}
- {x: 5.6000004, y: 2.2606773, z: 7}
- {x: 5.800001, y: 2.4505262, z: 7}
- {x: 6, y: 2.6481843, z: 7}
- {x: 6.200001, y: 2.822449, z: 7}
- {x: 6.3999996, y: 2.9458048, z: 7}
- {x: 6.6000004, y: 2.9987788, z: 7}
- {x: 6.800001, y: 2.973006, z: 7}
Frequency: 2
IsStrip: 0
--- !u!4 &1814793341
Transform:
@ -6930,8 +7068,8 @@ Transform:
m_GameObject: {fileID: 1814793339}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: -3, y: 2.5, z: 7}
m_LocalScale: {x: 20, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 289600336}

View File

@ -1,4 +1,3 @@
using System;
using UnityEngine;
namespace DCFApixels.DebugXCore.Samples
@ -7,7 +6,8 @@ namespace DCFApixels.DebugXCore.Samples
public class DebugXSample_LinesList : MonoBehaviour
{
public Color Color;
public Transform[] Points;
public Vector3[] Points = new Vector3[32];
public float Frequency = 1;
public bool IsStrip;
#if UNITY_EDITOR
@ -22,24 +22,27 @@ namespace DCFApixels.DebugXCore.Samples
}
#endif
private Vector3[] _convertedPoints = new Vector3[32];
private void Draw()
{
if(Points.Length > _convertedPoints.Length)
{
_convertedPoints = new Vector3[Points.Length << 1];
}
if (Points == null) { return; }
float sizeX = transform.localScale.x;
float sizeY = transform.localScale.y * 0.5f;
float start = transform.position.x - sizeX * 0.5f;
float step = sizeX / Points.Length;
for (int i = 0; i < Points.Length; i++)
{
_convertedPoints[i] = Points[i] == null ? Vector3.zero : Points[i].position;
float x = step * i;
float y = Mathf.Sin(x * Frequency) * sizeY;
Points[i] = new Vector3(start + x, transform.position.y + y, transform.position.z);
}
if (IsStrip)
{
DebugX.Draw(Color).LineStrip(_convertedPoints, Points.Length);
DebugX.Draw(Color).LineStrip(Points, 0, Points.Length);
}
else
{
DebugX.Draw(Color).Lines(_convertedPoints, Points.Length);
DebugX.Draw(Color).Lines(Points, 0, Points.Length);
}
}
}