Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-12-21 16:41:12 +08:00
parent 7f4e339032
commit be1ad1566b
12 changed files with 204488 additions and 4699 deletions

View File

@@ -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 (/)