修改core匹配问题
This commit is contained in:
@@ -4,10 +4,40 @@ using UnityEngine;
|
||||
using UnityEditor;
|
||||
public class DebugTools
|
||||
{
|
||||
|
||||
|
||||
//修改物体name
|
||||
[MenuItem("Modify/Name")]
|
||||
static void ModifyName()
|
||||
{
|
||||
if (Selection.activeGameObject == null)
|
||||
{
|
||||
Debug.LogWarning("请先选中一个物体");
|
||||
return;
|
||||
}
|
||||
foreach (Transform child in Selection.activeGameObject.transform)
|
||||
{
|
||||
if (!child.name.EndsWith("ViewPort"))
|
||||
{
|
||||
child.name = child.name + "ViewPort";
|
||||
// 或者使用 Undo 记录,方便撤销 (更专业)
|
||||
// Undo.RecordObject(child.gameObject, "Rename Child");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//输出物体的Position
|
||||
[MenuItem("PrintParameters/WorldPosition")]
|
||||
static void WorldPosition()
|
||||
{
|
||||
if (Selection.activeGameObject == null)
|
||||
{
|
||||
Debug.LogWarning("请先选中一个物体");
|
||||
return;
|
||||
}
|
||||
Debug.Log(Selection.activeGameObject.transform.position);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user