PathNode移除自带Transform和Color
This commit is contained in:
@@ -19,8 +19,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public SplinePoint node;
|
||||
|
||||
public static PathNode GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
Track track, Vector3 nodePosition, Vector3 nodeNormal, float nodeSize, Color nodeColor)
|
||||
public static PathNode GenerateElement(string elementName, Guid id, List<string> tags, Track track)
|
||||
{
|
||||
PathNode pathNode = Instantiate(EditorManager.instance.basePrefabs.pathNode, track.transform)
|
||||
.GetComponent<PathNode>();
|
||||
@@ -29,10 +28,9 @@ namespace Ichni.RhythmGame
|
||||
pathNode.track = track;
|
||||
//pathNode.index = index;
|
||||
|
||||
pathNode.transformSubmodule = new TransformSubmodule(pathNode, nodePosition,
|
||||
Quaternion.LookRotation(nodeNormal, Vector3.up).eulerAngles, Vector3.one * nodeSize);
|
||||
pathNode.transformSubmodule = new TransformSubmodule(pathNode);
|
||||
pathNode.timeDurationSubmodule = new TimeDurationSubmodule(pathNode);
|
||||
pathNode.colorSubmodule = new ColorSubmodule(pathNode, nodeColor);
|
||||
pathNode.colorSubmodule = new ColorSubmodule(pathNode);
|
||||
|
||||
track.trackPathSubmodule.pathNodeList.Add(pathNode);
|
||||
pathNode.SetParent(track);
|
||||
@@ -58,6 +56,10 @@ namespace Ichni.RhythmGame
|
||||
Vector3 normal = Quaternion.Euler(transformSubmodule.currentEulerAngles) * Vector3.up;
|
||||
float size = transformSubmodule.currentScale.x;
|
||||
Color color = colorSubmodule.currentBaseColor;
|
||||
|
||||
transform.position = position;
|
||||
transform.rotation = Quaternion.LookRotation(normal);
|
||||
transform.localScale = Vector3.one * size;
|
||||
|
||||
node = new SplinePoint(position, Vector3.up, normal, size, color);
|
||||
track.trackPathSubmodule.SetPathNode(this);
|
||||
@@ -68,8 +70,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.PathNode_BM(elementName, elementGuid, tags, parentElement.matchedBM, index,
|
||||
node.position, node.normal, node.size, node.color);
|
||||
matchedBM = new Beatmap.PathNode_BM(elementName, elementGuid, tags, parentElement.matchedBM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,38 +78,26 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class PathNode_BM : BaseElement_BM
|
||||
{
|
||||
public int index;
|
||||
public Vector3 position;
|
||||
public Vector3 normal;
|
||||
public float size;
|
||||
public Color color;
|
||||
|
||||
public PathNode_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PathNode_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement,
|
||||
int index, Vector3 position, Vector3 normal, float size, Color color)
|
||||
public PathNode_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.index = index;
|
||||
this.position = position;
|
||||
this.normal = normal;
|
||||
this.size = size;
|
||||
this.color = color;
|
||||
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = PathNode.GenerateElement(elementName, elementGuid, tags,
|
||||
GetElement(attachedElementGuid) as Track, position, normal, size, color);
|
||||
GetElement(attachedElementGuid) as Track);
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
{
|
||||
return PathNode.GenerateElement(elementName, elementGuid, tags, parent as Track,
|
||||
position, normal, size, color);
|
||||
return PathNode.GenerateElement(elementName, elementGuid, tags, parent as Track);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user