浏览代码

Update ReplaceTool.cs (#221)

/main
GitHub 4 年前
当前提交
0da85991
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 6
      UOP1_Project/Assets/Scripts/Editor/ReplaceTool.cs

6
UOP1_Project/Assets/Scripts/Editor/ReplaceTool.cs


{
var go = objectToReplace[i];
Undo.RegisterCompleteObjectUndo(go, "Saving game object state");
var inst = Instantiate(replaceObject, go.transform.position, go.transform.rotation, go.transform.parent);
var inst = (GameObject)PrefabUtility.InstantiatePrefab(replaceObject);
inst.transform.position = go.transform.position;
inst.transform.rotation = go.transform.rotation;
inst.transform.parent = go.transform.parent;
inst.transform.localScale = go.transform.localScale;
Undo.RegisterCreatedObjectUndo(inst, "Replacement creation.");
foreach (Transform child in go.transform)

正在加载...
取消
保存