浏览代码

Added option to replace name

/main
Thomas ICHÉ 5 年前
当前提交
eab76470
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 12
      Editor/FindAndReplace/FindAndReplaceWindow.cs

12
Editor/FindAndReplace/FindAndReplaceWindow.cs


[SerializeField]
bool replaceParenting = true;
[SerializeField]
bool replaceName = true;
[SerializeField]
bool replaceTag = false;
[SerializeField]
bool replaceLayer = true;

}
using (new GUILayout.HorizontalScope())
{
replaceTag = GUILayout.Toggle(replaceTag, "Tag", EditorStyles.miniButtonLeft, GUILayout.Height(16));
replaceName = GUILayout.Toggle(replaceName, "Name", EditorStyles.miniButtonLeft, GUILayout.Height(16));
replaceTag = GUILayout.Toggle(replaceTag, "Tag", EditorStyles.miniButtonMid, GUILayout.Height(16));
replaceLayer = GUILayout.Toggle(replaceLayer, "Layer", EditorStyles.miniButtonMid, GUILayout.Height(16));
replaceStatic = GUILayout.Toggle(replaceStatic, "Static Flag", EditorStyles.miniButtonRight, GUILayout.Height(16));
}

GameObject SwapObject(GameObject toReplace, GameObject replacement, List<GameObject> others)
{
var newObj = Instantiate<GameObject>(replacement);
newObj.name = replacement.name;
if (replaceName)
newObj.name = replacement.name;
else
newObj.name = toReplace.name;
if(replacePosition)
newObj.transform.position = toReplace.transform.position;
if(replaceRotation)

正在加载...
取消
保存