1
BIN
Assets/Dreamteck/.DS_Store
vendored
Normal file
BIN
Assets/Dreamteck/Splines/.DS_Store
vendored
Normal file
@@ -147,8 +147,8 @@ namespace Dreamteck.Splines
|
|||||||
private Spline[] _splines = new Spline[0];
|
private Spline[] _splines = new Spline[0];
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
[HideInInspector]
|
[HideInInspector]
|
||||||
private bool _initializedInEditor = false;
|
//private bool _initializedInEditor = false;
|
||||||
|
//不把这些warning消掉就难受
|
||||||
private int iterations => _subdivisions * _otherComputers.Length;
|
private int iterations => _subdivisions * _otherComputers.Length;
|
||||||
|
|
||||||
protected override void Awake()
|
protected override void Awake()
|
||||||
@@ -199,7 +199,8 @@ namespace Dreamteck.Splines
|
|||||||
{
|
{
|
||||||
_splines[i] = new Spline(ModeToSplineType(_subdivisionMode));
|
_splines[i] = new Spline(ModeToSplineType(_subdivisionMode));
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _splines.Length; i++)
|
for (int i = 0; i < _splines.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -208,7 +209,7 @@ namespace Dreamteck.Splines
|
|||||||
}
|
}
|
||||||
|
|
||||||
base.BuildMesh();
|
base.BuildMesh();
|
||||||
AllocateMesh(sampleCount * (iterations + 1), iterations * (sampleCount-1) * 6);
|
AllocateMesh(sampleCount * (iterations + 1), iterations * (sampleCount - 1) * 6);
|
||||||
_tsMesh.triangles = MeshUtility.GeneratePlaneTriangles(sampleCount - 1, iterations + 1, false);
|
_tsMesh.triangles = MeshUtility.GeneratePlaneTriangles(sampleCount - 1, iterations + 1, false);
|
||||||
GenerateVertices();
|
GenerateVertices();
|
||||||
_tsMesh.subMeshes.Clear();
|
_tsMesh.subMeshes.Clear();
|
||||||
@@ -275,7 +276,8 @@ namespace Dreamteck.Splines
|
|||||||
if (uvMode == UVMode.UniformClamp || uvMode == UVMode.UniformClip)
|
if (uvMode == UVMode.UniformClamp || uvMode == UVMode.UniformClip)
|
||||||
{
|
{
|
||||||
AddUVDistance(x);
|
AddUVDistance(x);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
GetSample(x, ref sample2);
|
GetSample(x, ref sample2);
|
||||||
}
|
}
|
||||||
@@ -292,11 +294,12 @@ namespace Dreamteck.Splines
|
|||||||
ydist += Vector3.Distance(lastPos, sample.position);
|
ydist += Vector3.Distance(lastPos, sample.position);
|
||||||
}
|
}
|
||||||
lastPos = sample.position;
|
lastPos = sample.position;
|
||||||
if (uvMode == UVMode.UniformClamp )
|
if (uvMode == UVMode.UniformClamp)
|
||||||
{
|
{
|
||||||
__uvs.x = CalculateUVUniformClamp(_vDist);
|
__uvs.x = CalculateUVUniformClamp(_vDist);
|
||||||
__uvs.y = CalculateUVUniformClamp(ydist);
|
__uvs.y = CalculateUVUniformClamp(ydist);
|
||||||
} else if(uvMode == UVMode.UniformClip)
|
}
|
||||||
|
else if (uvMode == UVMode.UniformClip)
|
||||||
{
|
{
|
||||||
__uvs.x = CalculateUVUniformClip(_vDist);
|
__uvs.x = CalculateUVUniformClip(_vDist);
|
||||||
__uvs.y = CalculateUVUniformClip(ydist);
|
__uvs.y = CalculateUVUniformClip(ydist);
|
||||||
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
@@ -20,7 +20,8 @@ namespace Dreamteck.Splines
|
|||||||
{
|
{
|
||||||
_size = value;
|
_size = value;
|
||||||
Rebuild();
|
Rebuild();
|
||||||
} else _size = value;
|
}
|
||||||
|
else _size = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,7 +448,8 @@ namespace Dreamteck.Splines
|
|||||||
if (sampleCount > 1)
|
if (sampleCount > 1)
|
||||||
{
|
{
|
||||||
BuildMesh();
|
BuildMesh();
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ClearMesh();
|
ClearMesh();
|
||||||
}
|
}
|
||||||
@@ -515,11 +517,11 @@ namespace Dreamteck.Splines
|
|||||||
|
|
||||||
protected virtual void AllocateMesh(int vertexCount, int trisCount)
|
protected virtual void AllocateMesh(int vertexCount, int trisCount)
|
||||||
{
|
{
|
||||||
if(trisCount < 0)
|
if (trisCount < 0)
|
||||||
{
|
{
|
||||||
trisCount = 0;
|
trisCount = 0;
|
||||||
}
|
}
|
||||||
if(vertexCount < 0)
|
if (vertexCount < 0)
|
||||||
{
|
{
|
||||||
vertexCount = 0;
|
vertexCount = 0;
|
||||||
}
|
}
|
||||||
@@ -595,7 +597,7 @@ namespace Dreamteck.Splines
|
|||||||
|
|
||||||
protected float GetBaseSize(SplineSample sample)
|
protected float GetBaseSize(SplineSample sample)
|
||||||
{
|
{
|
||||||
return _useSplineSize? sample.size: 1f;
|
return _useSplineSize ? sample.size : 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Color GetBaseColor(SplineSample sample)
|
protected Color GetBaseColor(SplineSample sample)
|
||||||
@@ -4,7 +4,7 @@ MonoImporter:
|
|||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: -10
|
||||||
icon: {fileID: 2800000, guid: 9bbaac8eb7021d44b9864113856c00fa, type: 3}
|
icon: {fileID: 2800000, guid: 9bbaac8eb7021d44b9864113856c00fa, type: 3}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||