Unity中的Inspector面板可以显示的属性包括以下两类:(1)C#以及Unity提供的基础类型:(2)自定义类型,并使用[System.Serializable]关键字序列化,比如: [System.Serializable] public class TestClass { public Vector3 vec = Vector3.zero; public Color clr = Color.green; } 也可以使用[System.NonSerialized]标记不需要显示的属性,
先上效果. 制作原理:模糊的部分是用UITexture,前面是一个UISprite.用主摄像机渲染出一张纹理,把这张纹理模糊处理,把这张纹理赋值给UITexture. 脚本代码 using UnityEngine; using System.Collections; [RequireComponent(typeof(UITexture))] public class BlurTextureMaker : MonoBehaviour { public int iterations = 3; pub
线上效果 确保你的纹理的read/write 是勾选的,纹理格式是 RGBA32的 //代码 using UnityEngine; [RequireComponent(typeof(UITexture))] public class ChangeTexturePixel : MonoBehaviour { private UITexture mUITex; private Texture2D MyTex; public int Radius = 10; public Color Col = ne
最近在学习unity编辑器,so,记录总结一下. 以下介绍了一些简单的unity3d检视面板部分的使用技巧. using UnityEngine; using System.Collections; //让你在将这个脚本拖到一个GameObject上的时候,自动添加Camera,Light,Cloth组件 [RequireComponent(typeof(Camera), typeof(Light), typeof(Cloth))] public class MyClass : MonoBeha
要学好C#,基础知识的重要性不言而喻,现将常用到的一些基础进行总结,总结如下: 1. 数据类型转换: 强制类型转换(Chart--> int): char cr='A'; int i = (int)(cr); 2. 委托/匿名函数/Lamda表达式: 委托是匿名函数的起源,Lamda表达式又是匿名函数的升华.这些又是如何体现的呢,请看: 委托示例: namespace Delegate { class Program { public delegate void TDelegate(int