在Unity开发游戏的时候,为了有一个更快更方便的工作流,我们往往会在Editor下开发一些方便实用的工具.在工具中,用到最多,最关键的就是按钮,它是工具的首席执行官.下面就用最简单的代码来演示添加一个自定义按钮到Inspector当中. 案例:指定坐标后克隆新物体到场景. 1. 在Unity Assets下创建”ObjectBuilderScript”脚本,添加代码: using UnityEngine; public class ObjectBuilderScript : MonoBeh
在扩展Unity的时候,往往会用到一些属性,这里将常用的列一下. 1.属性只读: #if UNITY_EDITOR using UnityEditor; #endif using UnityEngine; public class ReadOnlyAttribute : PropertyAttribute { } #if UNITY_EDITOR [CustomPropertyDrawer(typeof(ReadOnlyAttribute))] public class ReadOnlyDraw
通过声明的变量名称,主动关联引用. 使用这个关联引用两种方式1. 给你组件继承 MonoAutoQuote 点击组件inspector 按钮执行2. 给你组件类添加[AAutoQuote] 特性 通过Plateface/SetSelectGameRef 执行 [AAutoQuote] public class MonoAutoQuote : MonoBehaviour ,IAutoQuote{} public interface IAutoQuote { } public class A
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; using UnityEngine.UI; /// <summary> /// 文本控件,支持超链接.图片 /// </summ
new a gameobject & overloaded methds var go1 = new UnityEngine.GameObject.ctor(); var go2 = new UnityEngine.GameObject.ctor$$String("Hello"); add/get c# component (UnityEngine.Transform.ctor); (UnityEngine.UI.Image.ctor); image.set_color(/,
原地址:http://www.cnblogs.com/realtimepixels/p/3652086.html Unity AssetBundle Dependencies In the last few weeks I’ve spent quite a lot of time with Unity’s Asset Bundle system. Understanding how dependencies were tracked. What determines GC cleanup of