改改改
重大bug修复:track删除pathnode后不能正确更新 Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -79,6 +79,7 @@ namespace Ichni.RhythmGame
|
||||
public void OnDestroy()
|
||||
{
|
||||
track.trackPathSubmodule.pathNodeList.Remove(this);
|
||||
track.trackPathSubmodule.SetPathPoints();
|
||||
track.Refresh();
|
||||
print("PathNode " + elementName + " destroyed.");
|
||||
}
|
||||
|
||||
@@ -98,14 +98,11 @@ namespace Ichni.RhythmGame
|
||||
SetUpSplineComputer(trackSpaceType, trackSamplingType);
|
||||
|
||||
|
||||
foreach (var pathNode in pathNodeList)
|
||||
{
|
||||
SetPathNode(pathNode);
|
||||
}
|
||||
|
||||
ClosePath();
|
||||
path.Rebuild(true);
|
||||
}
|
||||
|
||||
public void SortPathnodeInChildren()//emm待用吧
|
||||
{
|
||||
Debug.Log("TrackSort");
|
||||
@@ -127,6 +124,14 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public partial class TrackPathSubmodule
|
||||
{
|
||||
public void SetPathPoints()
|
||||
{
|
||||
path.SetPoints(new SplinePoint[0]);
|
||||
foreach (var pathNode in pathNodeList)
|
||||
{
|
||||
SetPathNode(pathNode);
|
||||
}
|
||||
}
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new TrackPathSubmodule_BM(attachedGameElement, this);
|
||||
|
||||
@@ -44,11 +44,13 @@ namespace Ichni.RhythmGame
|
||||
this.materialThemeBundleName = materialThemeBundleName;
|
||||
this.materialName = materialName;
|
||||
Material mat = ThemeBundleManager.instance.GetObject<Material>(materialThemeBundleName, materialName);
|
||||
if (mat != null)
|
||||
if (mat == null)
|
||||
{
|
||||
renderMaterial = mat;
|
||||
meshRenderer.material = renderMaterial;
|
||||
mat = EditorManager.instance.basePrefabs.defaultTrackMaterial;
|
||||
|
||||
}
|
||||
renderMaterial = mat;
|
||||
meshRenderer.material = renderMaterial;
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
@@ -136,7 +138,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
if (enableEmission)
|
||||
{
|
||||
meshRenderer.material.EnableKeyword("_EMISSION_ON");
|
||||
meshRenderer.material.EnableKeyword("_EMISSION_ON");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -193,7 +195,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
|
||||
public TrackRendererSubmoduleAutoOrient_BM()
|
||||
{
|
||||
@@ -207,7 +209,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
@@ -273,7 +275,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
|
||||
public TrackRendererSubmodulePathGenerator_BM()
|
||||
{
|
||||
@@ -287,6 +289,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
@@ -372,7 +375,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
public int sideCount;
|
||||
|
||||
public TrackRendererSubmoduleTubeGenerator_BM()
|
||||
@@ -387,6 +390,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
sideCount = trackRendererSubmodule.sideCount;
|
||||
}
|
||||
|
||||
@@ -453,7 +457,7 @@ namespace Ichni.RhythmGame
|
||||
public string materialName;
|
||||
public bool enableEmission;
|
||||
public float emissionIntensity;
|
||||
public bool zWrite;
|
||||
public bool zWrite; // 新增
|
||||
|
||||
public TrackRendererSubmoduleSurface_BM()
|
||||
{
|
||||
@@ -467,6 +471,7 @@ namespace Ichni.RhythmGame
|
||||
materialName = trackRendererSubmodule.materialName;
|
||||
enableEmission = trackRendererSubmodule.enableEmission;
|
||||
emissionIntensity = trackRendererSubmodule.emissionIntensity;
|
||||
zWrite = trackRendererSubmodule.zWrite; // 新增
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
|
||||
Reference in New Issue
Block a user