摘要: (1)NULLnull 关键字是表示不引用任何对象的空引用的文字值。null 是引用类型变量的默认值。那么也只有引用型的变量可以为NULL,如果int i=null,的话,是不可以的,因为Int是值类型的。 (2)""和String.Empty 这两个都是表示空字符串。只不过""理论上重新开辟内存空 阅读全文
posted @ 2019-09-04 10:01 C#初学者—Damon 阅读(256) 评论(0) 推荐(0) 编辑
摘要: using的用途和使用技巧. 1、 引用命名空间 2、 为命名空间或类型创建别名 3、 使用using语句 1、 引用命名空间,这样可以在程序中引用命名空间的类型而不必指定详细的命名空间. a) 比如在程序中常用的using System.Text; b) 引用命名空间,并不等于编译器编译时加载该命 阅读全文
posted @ 2019-09-04 09:50 C#初学者—Damon 阅读(979) 评论(0) 推荐(0) 编辑
摘要: 文件与文件夹操作主要用到以下几个类: 1.File类: 提供用于创建、复制、删除、移动和打开文件的静态方法,并协助创建 FileStream 对象。 msdn:http://msdn.microsoft.com/zh-cn/library/system.io.file(v=VS.80).aspx 2 阅读全文
posted @ 2019-09-03 10:30 C#初学者—Damon 阅读(1843) 评论(0) 推荐(1) 编辑
摘要: 来源:http://blog.csdn.net/ynnmnm/article/details/52253674 http://www.jianshu.com/p/bbc2690bce30 Application.dataPath Application.streamingAssetsPath App 阅读全文
posted @ 2019-09-03 10:05 C#初学者—Damon 阅读(3833) 评论(0) 推荐(0) 编辑
摘要: 1. 隐藏文件夹以.开头的文件夹会被Unity忽略。在这种文件夹中的资源不会被导入,脚本不会被编译。也不会出现在Project视图中。2. Standard Assets在这个文件夹中的脚本最先被编译。这个文件夹中的脚本会被导出到Assembly-CSharp-firstpass, Assembly 阅读全文
posted @ 2019-09-02 10:57 C#初学者—Damon 阅读(1703) 评论(0) 推荐(0) 编辑
摘要: 1.引用命名空间 using System.Xml; using System.IO; 2.生成Xml public void createXml() { //xml保存的路径,这里放在Assets路径 注意路径。 string filepath = Application.dataPath + @ 阅读全文
posted @ 2019-08-29 18:58 C#初学者—Damon 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 一、UnityJson(Unity引擎自带) 1.文本转Json //(item文本信息) JsonUtility.ToJson(item)); 2.读取Json文件 //<InFo_>转化的类型,(jsonTex)Json文件 JsonUtility.FromJson<InFo__>(jsonTx 阅读全文
posted @ 2019-08-29 17:57 C#初学者—Damon 阅读(2364) 评论(0) 推荐(0) 编辑
摘要: 1.Assets下创建文件夹Plugins 2.在Plugins下创建脚本SimpleJSON 3.进http://wiki.unity3d.com/index.php/SimpleJSON自己复制 4.引用命名空间 using SimpJSON;5.解析Json文件 public ShowArti 阅读全文
posted @ 2019-08-29 17:00 C#初学者—Damon 阅读(2613) 评论(0) 推荐(0) 编辑
摘要: IPointerEnterHandler指针进入public void OnPointerEnter(PointerEventData eventData); IPointerExitHandler指针退出public void OnPointerExit(PointerEventData even 阅读全文
posted @ 2019-08-28 20:28 C#初学者—Damon 阅读(643) 评论(0) 推荐(0) 编辑
摘要: 一、Unity常用组件拓展方法 (1) Transform拓展方法 1)Position 1)改变世界坐标 移动方法,第一个参数是要移动到的目标点,不是移动这个向量的距离 transform.DOMove(new Vector3(1, 1, 1), 2); 只控制x轴上的移动,其他两个方向同理 tr 阅读全文
posted @ 2019-08-17 10:03 C#初学者—Damon 阅读(21471) 评论(0) 推荐(2) 编辑