摘要: 表示在该构造函数执行之前初始化该变量! 阅读全文
posted @ 2014-04-13 16:58 Vital 阅读(492) 评论(0) 推荐(0)
摘要: using UnityEngine;using System.Collections;public class JoystickC : MonoBehaviour { private Vector2 min = Vector2.zero; private Vector2 max = Vector2.zero; static private JoystickC[] joysticks; // A static collection of all joysticks static private bool enumeratedJ... 阅读全文
posted @ 2014-03-03 11:27 Vital 阅读(1762) 评论(0) 推荐(0)
摘要: private void OnScreenCapture () { //yield return new WaitForEndOfFrame(); try { int width = Screen.width; int height = Screen.height-reduceHigh; Texture2D tex = new Texture2D (width, height, TextureFormat.RGB24, false); tex.ReadPixels (new Rect (0, bottomStarH, width, height), 0, 0, ... 阅读全文
posted @ 2014-02-24 10:34 Vital 阅读(3729) 评论(1) 推荐(1)
摘要: /* * * 改编后的unity3D Resources 类,使用起来更加方便,省略了在代码中拆箱装箱的操作 * * * * */using UnityEngine;public class ResourcesEx{ private string path; public ResourcesEx(string path) { if (path.Length == 0) { this.path = string.Empty; } else { ... 阅读全文
posted @ 2014-02-21 11:25 Vital 阅读(629) 评论(0) 推荐(0)
摘要: C货币2.5.ToString("C")¥2.50D十进制数25.ToString("D5")00025E科学型25000.ToString("E")2.500000E+005F固定点25.ToString("F2")25.00G常规2.5.ToString("G")2.5N数字2500000.ToString("N")2,500,000.00X十六进制255.ToString("X")FF 阅读全文
posted @ 2014-01-08 15:26 Vital 阅读(944) 评论(0) 推荐(0)
摘要: LoadFromCacheOrDownload()取代"new WWW (url)"为了充分利用缓存功能。缓存的资源包完全由文件名和版本号唯一标识;URL所有域名和路径信息在缓存被忽略。由于缓存的资源包通过文件名而不是完整的URL来识别,在任何时候资源包被下载,你可以更改目录。对于推出了游戏的新版本确保文件通过浏览器或CDN不是错误的缓存,这是很有用的。对于网络播放器应用程序使用共享缓存,缓存增加了唯一标识信息为了防止应用程序间同名的资源包名称冲突。如果缓存文件夹中没有任何空间来缓存额外的文件,LoadFromCacheOrDownload会反复从缓存中删除最近最少使用资源 阅读全文
posted @ 2013-12-04 16:27 Vital 阅读(772) 评论(0) 推荐(0)
摘要: private GameObject[] myObj; private GameObject obj; void Start () { myObj = new GameObject[4]; ///只有这样,如果在下面引用时会报错的,说你没有引用到实例 Testooo(); obj = new GameObject("11"); } // Update is called once per frame void Update () { } void Testooo()... 阅读全文
posted @ 2013-11-12 14:56 Vital 阅读(14177) 评论(0) 推荐(0)
摘要: IOS:Application.dataPath :Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/DataApplication.streamingAssetsPath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data/RawApplication.persistentDataPath :Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/DocumentsApplication.temporaryCac 阅读全文
posted @ 2013-10-31 14:50 Vital 阅读(694) 评论(0) 推荐(0)
摘要: 装箱(Boxing)是指将值类型转化为Object类型或由此值类型实现任意一接口类型的过程。装箱用于在垃圾回收堆中存储值类型。装箱是值类型到object类型或到此值类型所实现的任何接口类型的隐式转换。对值类型装箱会在堆中分配一个对象实例,并将该值复制到新的对象中。拆箱(UnBoxing)是将从对象中提取值类型。拆箱是从object类型到值类型或从接口类型到实现该接口的值类型的显式转换。拆箱操作包括:检查对象实例,以确保它是给定值类型的装箱值。将该值从实例复制到值类型变量中。装箱是隐式的,拆箱是显式的。性能消耗:相对于简单的赋值而言,装箱和取消装箱过程需要进行大量的计算。对值类型进行装箱时,必须 阅读全文
posted @ 2013-10-30 15:14 Vital 阅读(718) 评论(0) 推荐(0)
摘要: GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(Screen.width / 1024.0f, Screen.height / 768.0f, 1.0f)); /////自适应分辨率,已1024*768为标准 阅读全文
posted @ 2013-10-29 10:22 Vital 阅读(288) 评论(0) 推荐(0)