@@ -433,6 +433,29 @@ namespace Ichni.Editor
|
||||
SplitHoldToTrack(PathnodesCount);
|
||||
}
|
||||
}
|
||||
public static void ScalePathNodesXY(float scale, Vector2 scalePoint)
|
||||
{
|
||||
if (inspector.connectedGameElement == null || (inspector.connectedGameElement.GetType() != typeof(Track) && inspector.connectedGameElement.GetType() != typeof(ElementFolder)))
|
||||
{
|
||||
LogWindow.Log("Please select a Folder or Track first!");
|
||||
return;
|
||||
}
|
||||
foreach (var i in inspector.connectedGameElement.GetAllGameElementsFromThis().OfType<Track>())
|
||||
{
|
||||
Track track = (Track)i;
|
||||
var pathnodes = track.trackPathSubmodule.pathNodeList;
|
||||
foreach (var pathnode in pathnodes)
|
||||
{
|
||||
Vector2 dir = new Vector2(pathnode.transform.position.x, pathnode.transform.position.y) - scalePoint;
|
||||
Vector3 newPos = new Vector3(dir.x * scale + scalePoint.x, dir.y * scale + scalePoint.y, pathnode.transform.position.z);
|
||||
pathnode.transform.position = newPos;
|
||||
pathnode.transformSubmodule.originalPosition = pathnode.transform.localPosition;
|
||||
pathnode.transformSubmodule.Refresh();
|
||||
pathnode.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Note Import/Export (音符导入/导出)
|
||||
|
||||
Reference in New Issue
Block a user