摘要: 1. 使用 WWW 加载,详细查看 unity3d 官方文档。 2. 使用 System.IO 加载,lua 代码如下: 转载请注明出处:http://www.cnblogs.com/jietian331/p/5175816.html 阅读全文
posted @ 2016-02-01 17:15 孤独の巡礼 阅读(4899) 评论(0) 推荐(0) 编辑
摘要: unity中, 将图集的 alpha 通道剥离出来可减少包体大小和内存使用大小。 方法是将原来的一张 rgba 图分成一张 rgb 和一张 alpha 图,android上rgb和alpha图均采用etc压缩格式,ios上采用pvrtc格式。其中alpha通道信息可以存在r中。 分享 alpha 通 阅读全文
posted @ 2016-01-28 20:34 孤独の巡礼 阅读(5185) 评论(0) 推荐(0) 编辑
摘要: CG 中的数据变量类型有三: float:高精度浮点值,通常是32位。 half:中精度浮点值。通常是16位,范围是-60000至+60000,它适合存储UV坐标,颜色值等。 fixed:低精度浮点值。通常是11位,范围是-2.0至+2.0,精度为1/256。这是三者中最小的一个,可以用于光照计算、 阅读全文
posted @ 2016-01-28 16:43 孤独の巡礼 阅读(379) 评论(0) 推荐(0) 编辑
摘要: Model and view transformVertex shadingProjectionClippingScreen mappingTriangle setupTriangle traversalPixel shadingMerging 阅读全文
posted @ 2016-01-18 11:03 孤独の巡礼 阅读(195) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections;using UnityEngine;// This class just convert from CharacterMotor.js to C#[RequireComponent(typeof(CharacterContr... 阅读全文
posted @ 2016-01-06 11:38 孤独の巡礼 阅读(1659) 评论(0) 推荐(0) 编辑
摘要: 使用 unity 做游戏开发时,有时需要在scroll view下使用粒子,但粒子是不会被 UIPanel 所裁剪的,本人提供了脚本 ParticleSystemClipper,用来处理这种情况。思路是,通过 UIPanel 的 finalClipRegion 换算成 unity3d 世界坐标系中的 阅读全文
posted @ 2015-12-25 11:55 孤独の巡礼 阅读(5302) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.csdn.net/azhou_hui/article/details/50790870 1. 本地推送主要包括在android和ios上,下面所有的代码都是本人写的,经过测试是没有问题的,已经运用到项目中了。首先是接口INotification: using Syste 阅读全文
posted @ 2015-12-07 11:14 孤独の巡礼 阅读(4109) 评论(2) 推荐(1) 编辑
摘要: 1. 时间戳转 DateTime static DateTime GetServerNow(ulong serverTime) { DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTim... 阅读全文
posted @ 2015-12-07 11:01 孤独の巡礼 阅读(751) 评论(0) 推荐(0) 编辑
摘要: 项目的配置文件为了和服务器保持一致,每次打包时都从网上下载配置文件,由于下载的是zip压缩包,还需要解压,代码如下: 转载请注明出处:http://www.cnblogs.com/jietian331/p/5019492.html 阅读全文
posted @ 2015-12-04 15:44 孤独の巡礼 阅读(2050) 评论(0) 推荐(0) 编辑
摘要: 相同的 lua 代码在安卓上能正常运行,但在 IOS 上可能不会正常运行而导致报红,崩溃等,我在使用 lua 编程时遇到的一些坑总结如下: 1. File.ReadAllText, 诸如以下代码在 ios 上会崩: 正确写法如下: 需指定编码格式。 2. DateTime.AddMinutes 在 阅读全文
posted @ 2015-11-17 11:15 孤独の巡礼 阅读(1748) 评论(1) 推荐(0) 编辑