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;
}
}
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;
}
}
相关文章推荐
- UnityProject面板中右键创建新的Lua脚本以及修改文件默认打开方式的编辑器
- Unity编辑器拓展之五:修改脚本icon
- unity编辑器拓展六——不实例化的情况下修改Assets下面的文件
- Unity编辑器下获取动画的根运动状态并修改
- Unity-【编辑器扩展】一键批量修改预设UGUI Text字体
- Unity一键修改NGUI字体的编辑器脚本
- Unity 3D - 编辑器扩展之修改PackingTag
- unity 扩展编辑器一(修改编辑器名称)
- unity 编辑器扩展 修改代码的值
- Unity编辑器扩展之修改扩展脚本的成员变量
- Unity编辑器 - 资源修改立即写入磁盘AssetDataBase.SaveAssets()
- Unity琐碎(1) 编辑器参数修改
- unity角色控制器修改(鼠标右键按住旋转视角)
- 修改AutoHotKey默认代码编辑器为Gvim
- eclipse修改编辑器字体 + Eclipse自动提示(Content Assist) + Eclipse汉化
- linux修改默认的编辑器
- Unity编辑器扩展-基本界面编写
- VIM修改编辑器文本颜色
- Unity控制物体旋转修改物体颜色
- [Unity] Unity5.6 2D中导入图片顶点数目过多修改为四个顶点