您的位置:首页 > 移动开发 > Unity3D

unity 修改编辑器

2017-09-18 16:51 281 查看
给Unity编辑器添加内容:  MenuItem

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class HAHAHA : MonoBehaviour {

[MenuItem("GameObject/MyCategory/Custom Game Object", false, 0)]
static void CreateCustomGameObject(MenuCommand menuCommand)
{
menuCommand.context = Selection.activeObject;
GameObject go = new GameObject("Custom Game Object");
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
Undo.RegisterCreatedObjectUndo(go, "Create " + go);
Selection.activeObject = go;
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Unity c# 编辑器