基础内容-6
技术性调整; Note效果;
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Ichni;
|
||||
using Lean.Pool;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -12,34 +13,30 @@ namespace Ichni.RhythmGame
|
||||
public ColorSubmodule colorSubmodule;
|
||||
|
||||
public Track track;
|
||||
public int index;
|
||||
|
||||
public int index => track.trackPathSubmodule.pathNodeList.IndexOf(this);
|
||||
|
||||
public SplinePoint node;
|
||||
|
||||
public static PathNode GeneratePathNode(string elementName, Track track, int index, Vector3 nodePosition,
|
||||
public static PathNode GenerateElement(string elementName, Track track, int index, Vector3 nodePosition,
|
||||
Vector3 nodeNormal, float nodeSize, Color nodeColor)
|
||||
{
|
||||
PathNode pathNode = LeanPool.Spawn(EditorManager.instance.basePrefabs.pathNode, track.transform).GetComponent<PathNode>();
|
||||
PathNode pathNode = Instantiate(EditorManager.instance.basePrefabs.pathNode, track.transform).GetComponent<PathNode>();
|
||||
|
||||
pathNode.NewInitialize(elementName, track, index, nodePosition, nodeNormal, nodeSize, nodeColor);
|
||||
pathNode.Initialize(elementName);
|
||||
pathNode.track = track;
|
||||
//pathNode.index = index;
|
||||
|
||||
pathNode.transformSubmodule = new TransformSubmodule(pathNode, nodePosition, Quaternion.LookRotation(nodeNormal, Vector3.up).eulerAngles, Vector3.one * nodeSize);
|
||||
pathNode.timeDurationSubmodule = new TimeDurationSubmodule(pathNode);
|
||||
pathNode.colorSubmodule = new ColorSubmodule(pathNode, nodeColor);
|
||||
|
||||
track.trackPathSubmodule.pathNodeList.Add(pathNode);
|
||||
pathNode.SetParent(track);
|
||||
|
||||
return pathNode;
|
||||
}
|
||||
|
||||
public void NewInitialize(string elementName, Track track, int index, Vector3 nodePosition,
|
||||
Vector3 nodeNormal, float nodeSize, Color nodeColor)
|
||||
{
|
||||
base.NewInitialize(elementName);
|
||||
this.track = track;
|
||||
this.index = index;
|
||||
|
||||
this.transformSubmodule = new TransformSubmodule(nodePosition, Quaternion.LookRotation(nodeNormal, Vector3.up).eulerAngles, Vector3.one * nodeSize);
|
||||
this.colorSubmodule = new ColorSubmodule(nodeColor);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
Refresh();
|
||||
|
||||
Reference in New Issue
Block a user