@@ -593,7 +593,30 @@ namespace Ichni.Editor
|
||||
GUIUtility.systemCopyBuffer = result;
|
||||
LogWindow.Log("Colped Done!", Color.green);
|
||||
}
|
||||
|
||||
public static void AdjustPathnodeZ(float OriginZpoint, float scale)
|
||||
{
|
||||
if (inspector.connectedGameElement == null || inspector.connectedGameElement.GetType() != typeof(Track))
|
||||
{
|
||||
LogWindow.Log("Please select a Track first!");
|
||||
return;
|
||||
}
|
||||
Track track = (Track)inspector.connectedGameElement;
|
||||
var pathnodes = track.trackPathSubmodule.pathNodeList;
|
||||
foreach (var pathnode in pathnodes)
|
||||
{
|
||||
if (pathnode.childElementList.OfType<Displacement>().Count() > 0)
|
||||
{
|
||||
LogWindow.Log($"PathNode {pathnode.elementName} has Displacement, which may cause issues", Color.yellow);
|
||||
}
|
||||
float worldZ = pathnode.transform.position.z;
|
||||
float deltaZ = worldZ - OriginZpoint;
|
||||
float newZ = OriginZpoint + deltaZ * scale;
|
||||
pathnode.transform.position = new Vector3(pathnode.transform.position.x, pathnode.transform.position.y, newZ);
|
||||
pathnode.transformSubmodule.originalPosition = pathnode.transform.localPosition;
|
||||
pathnode.transformSubmodule.Refresh();
|
||||
pathnode.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user