摘要:        
代码: using UnityEngine;using UnityEditor;public class MyWidow : EditorWindow{ [MenuItem("Window/Show MyWindow")] static void ShowMyWindow() { MyWidow m    阅读全文
posted @ 2017-11-16 11:22
爱上游戏开发
阅读(952)
评论(0)
推荐(0)
        
            
        
        
摘要:        
代码: using UnityEditor;using UnityEngine;public class ChangeValue : ScriptableWizard { public int health = 10; public int speed = 23; [MenuItem("Tools/    阅读全文
posted @ 2017-11-16 11:19
爱上游戏开发
阅读(660)
评论(0)
推荐(0)
        
            
        
        
摘要:        
代码: [MenuItem("Tools/Delete ", true, 1)] static bool DeleteVadidate() { if (Selection.gameObjects.Length > 0) return true; else return false; } [MenuI    阅读全文
posted @ 2017-11-16 11:03
爱上游戏开发
阅读(367)
评论(0)
推荐(0)
        
            
        
        
摘要:        
代码: [MenuItem("Tools/Delete",false,1)] static void Delete() { GameObject[] go = Selection.gameObjects; foreach (GameObject g in go) { //GameObject.Des    阅读全文
posted @ 2017-11-16 10:56
爱上游戏开发
阅读(2291)
评论(0)
推荐(0)
        
            
        
        
摘要:        
代码: [MenuItem("Tools/GetChance", false, 1)] static void GetChance() { if (Selection.gameObjects.Length > 0) { Debug.Log(Selection.activeGameObject.nam    阅读全文
posted @ 2017-11-16 10:53
爱上游戏开发
阅读(1748)
评论(0)
推荐(0)
        
            
        
        
摘要:        
在组件中右击创建一个选项代码: [MenuItem("CONTEXT/PlayerHealth/InitHealth")] static void Test5() { Debug.Log("init"); } 说明:MenuItem中第二个参数:组件名 MenuItem中第三个参数:选项名 修改该组    阅读全文
posted @ 2017-11-16 10:48
爱上游戏开发
阅读(695)
评论(0)
推荐(0)
        
            
        
        
摘要:        
在Hierarchy面板创建选项的代码: [MenuItem("GameObject/Test",false,1)] static void Test1() { Debug.Log("test"); } 在Project面板创建选项的代码: [MenuItem("Assets/Test")] sta    阅读全文
posted @ 2017-11-16 10:42
爱上游戏开发
阅读(573)
评论(0)
推荐(0)
        
            
        
        
摘要:        
代码: [MenuItem("Tools/Test",false,1)] static void Test() { Debug.Log("test"); } 注意:MenuItem中第一个参数:需要创建选项在工具栏中的路径,此路径的父目录可以是Unity中已存在的,也可以自己直接同子目录一起创建,例    阅读全文
posted @ 2017-11-16 10:37
爱上游戏开发
阅读(1995)
评论(0)
推荐(0)
        
 

 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号