实现bake的自动化,但是autoorient的重建还是需要一些优化
Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -72,7 +72,11 @@ public class consoleOnMono : MonoBehaviour
|
||||
newTrack, float.Parse(parts[4]), float.Parse(parts[5]), float.Parse(parts[6]), (AnimationCurveType)int.Parse(parts[7])
|
||||
);
|
||||
newTrack.trackRendererSubmodule = new TrackRendererSubmoduleAutoOrient(newTrack, false, 0, false, new Vector2(0, 0), new Vector2(1, 1));
|
||||
|
||||
bool isClosed = parts[9] == "1";
|
||||
if (newTrack.trackPathSubmodule != null)
|
||||
{
|
||||
newTrack.trackPathSubmodule.isClosed = isClosed;
|
||||
}
|
||||
tracks.Add(tId, newTrack); // 先加入字典,方便后续 PN 指令查找
|
||||
}
|
||||
break;
|
||||
@@ -82,14 +86,15 @@ public class consoleOnMono : MonoBehaviour
|
||||
string targetTrackId = parts[1];
|
||||
Track targetTrack = tracks[targetTrackId];
|
||||
Vector3 pos = new Vector3(float.Parse(parts[2]), float.Parse(parts[3]), float.Parse(parts[4]));
|
||||
Color nodeColor = new Color(float.Parse(parts[5]), float.Parse(parts[6]), float.Parse(parts[7]), 1.0f);
|
||||
|
||||
// 生成节点并挂载到轨道
|
||||
var node = PathNode.GenerateElement(pos.ToString(), Guid.NewGuid(), new List<string>(), true, targetTrack, true);
|
||||
node.transformSubmodule.originalPosition = pos;
|
||||
node.transformSubmodule.originalScale = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
|
||||
node.colorSubmodule.originalBaseColor = nodeColor;
|
||||
// 标记轨道需要刷新(可选:为了性能可以等所有 PN 完后再统一 Refresh)
|
||||
targetTrack.Refresh();
|
||||
|
||||
}
|
||||
break;
|
||||
case "SW": // 应用旋转 (旧版相机取反)
|
||||
@@ -137,6 +142,9 @@ new List<AnimatedFloat> { new(startTime, endTime, startRot.x, endRot.x, (Animati
|
||||
}
|
||||
}
|
||||
text.text = "Completed!";
|
||||
|
||||
foreach (var i in rootFolder.GetAllGameElementsFromThis())
|
||||
{
|
||||
i.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user