摘要: 线上效果 确保你的纹理的read/write 是勾选的,纹理格式是 RGBA32的 //代码 阅读全文
posted @ 2016-04-29 18:30 MrBlue 阅读(1499) 评论(0) 推荐(0) 编辑
摘要: 一个非常简单的方法,直接上代码。 阅读全文
posted @ 2016-04-22 17:57 MrBlue 阅读(1408) 评论(0) 推荐(1) 编辑
摘要: 一、使用方式: 1、选择要被查找的资源,右键->Find Reference 2、把资源拽入Res,点Find 3、输出结果见Console //代码 阅读全文
posted @ 2016-04-18 20:08 MrBlue 阅读(2510) 评论(0) 推荐(0) 编辑
摘要: 一、先看下效果 Prefab结构 二、实现思路: 1、prefab上的Panel层级设置成较高 2、背景由5个UISprite拼接起来的,4个(L,R,U,D)当作遮罩,1个镂空(Hollow)当作点击触发(全部都有BoxCollider,并且都生效,有人会问这不就把后面的按钮也给拦截住了,后面会说 阅读全文
posted @ 2016-04-18 17:15 MrBlue 阅读(2764) 评论(0) 推荐(0) 编辑
摘要: 效果图,真的很叼啊 我根据别人的改进了一版,支持MeshFilter上的Mesh(需要确保Mesh的Read/Write是开启的否则不能正常工作) 非常感谢原作者给提供思路。http://blog.csdn.net/langresser_king/article/details/50976029 代 阅读全文
posted @ 2016-04-07 20:25 MrBlue 阅读(3737) 评论(0) 推荐(0) 编辑
摘要: 先上效果 有个问题就是,UISprie用的Atlas的公用的材质,无法从当前要绘制的片段shader上获得uv百分比,所以当有其他的Sprite使用相同的Atlas时显示就有问题 其实Mesh是可以接受另外一套uv的,不过目前还没有找到给NGUI造的mesh传另外一套uv的方法。 //代码 //Sh 阅读全文
posted @ 2016-03-25 16:26 MrBlue 阅读(1458) 评论(0) 推荐(0) 编辑
摘要: 原理就是用新造的部件和角色的骨骼进行重新对接。 demo的使用方法: PartIdx设置要换那个部件[0,4],一共5个部件 EquipIdx设置要更换部件的装备索引[0,1],具体看我的ChangeEquip的PartList。 点击Test执行换装 //换装源码 using UnityEngin 阅读全文
posted @ 2016-03-02 20:58 MrBlue 阅读(3683) 评论(1) 推荐(0) 编辑
摘要: 最近有个需求是想让程序解析策划编辑一个文本生成一段CG,内容使用大致是这样 cgSetCameraEx(118.6324,30.71189,75.55666,45,-45,0,0) cgCloneMyPlayer(1) cgSetPosDir(1,109,80,0) cgSetCameraEx(11 阅读全文
posted @ 2016-03-01 17:43 MrBlue 阅读(662) 评论(0) 推荐(0) 编辑
摘要: 代码 using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using System; [RequireComponent(typeof(Image)) 阅读全文
posted @ 2016-02-15 19:01 MrBlue 阅读(12220) 评论(0) 推荐(0) 编辑
摘要: 效果 BurnToFadeOut.shader代码 Shader "BurnToFadeOut" { Properties { _StartColor ("Start Color", Color) = (1,1,1,1) _EndColor ("End Color", Color) = (1,1,1 阅读全文
posted @ 2016-02-15 15:04 MrBlue 阅读(2646) 评论(0) 推荐(0) 编辑
摘要: UnityPro内置的NavMesh有几个API很有用 NavMesh.SamplePosition 根据给的点进行采样,可传入最大距离,返回true说明采样到了点,否则采样失败(可以用来获得地形高度,但是最大距离不要太大,注意效率) NavMesh.Raycast 向目标点发射一条射线,返回tru 阅读全文
posted @ 2016-02-01 16:12 MrBlue 阅读(3105) 评论(0) 推荐(0) 编辑
摘要: 先上效果,左边模糊 其实用的是Unity Stard Effect里的资源,一个脚本一个shader //脚本代码 using UnityEngine; using System.Collections; [ExecuteInEditMode] [AddComponentMenu("Image Ef 阅读全文
posted @ 2016-01-29 10:49 MrBlue 阅读(3847) 评论(0) 推荐(1) 编辑
摘要: 先上效果 Shader 脚本 搞法: 1、创建个材质命名成UITexture_Flow.mat,把上面的shader拖拽进去。 2、创建GameObject,挂上UITexture(不用修改的材质,原因是我代码里会去修改他的材质。为什么总是new 新的材质,原因是每个UITexture都要自己流动自 阅读全文
posted @ 2016-01-27 13:55 MrBlue 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 为了解决用Application.LoadLevelAdditiveAsync 导致新场景的Navmesh数据不正确(我们用的是4.63),我们现在loading条做法是先切到Loading的场景,然后把Loading的GameObject标记成DontDestroyOnLoad,然后调用Appli... 阅读全文
posted @ 2016-01-27 13:45 MrBlue 阅读(944) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections;using UnityEditor;using System.Collections.Generic;using System.ComponentModel;using Object = UnityEngine.O... 阅读全文
posted @ 2016-01-04 16:51 MrBlue 阅读(751) 评论(0) 推荐(0) 编辑
摘要: 项目开始使用IL2CPP编译,后果是可执行文件急剧增加。google后发现国外一大神写的方法,原帖在这http://forum.unity3d.com/threads/suggestion-for-reducing-the-size-of-il2cpp-generated-executable.33... 阅读全文
posted @ 2015-11-19 20:46 MrBlue 阅读(4242) 评论(1) 推荐(0) 编辑
摘要: 最近在做一些优化工具,把鼠标拣选的功能单独抽出来。可遍历所有选中的某类型资源,会递归文件夹可编译所有prefab的某个Component,也是递归的using UnityEngine;using System.Collections;using UnityEditor;using System.Co... 阅读全文
posted @ 2015-11-13 18:16 MrBlue 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 适用情景:策划在用NGUI制作UI prefab时经常会使用一些临时的Atlas,然后再想改就不知道都哪些使用了。现在想修改下使用临时资源的GameObject使用方式,先选中某个prefab或者某个包含prefab的文件夹,点Tools->Find atlas reference object i... 阅读全文
posted @ 2015-11-07 11:40 MrBlue 阅读(1183) 评论(0) 推荐(0) 编辑
摘要: 转自http://www.xuanyusong.com/archives/3042最近在做UI部分中遇到了这样的问题,就是Prefab里面预制了Prefab。可是在Unity里面一旦Prefab预制了Prefab那么内部的Prefab就失去关联。导致与如果要改内部的Prefab需要把所有引用的地方全... 阅读全文
posted @ 2015-11-06 14:42 MrBlue 阅读(1224) 评论(0) 推荐(0) 编辑
摘要: 适用情景:主角带着光环,光环用一张贴图,要贴在地面上,并且随地面凹凸起伏//代码using UnityEngine;using System.Collections;[RequireComponent(typeof(MeshFilter))][RequireComponent(typeof(Mesh... 阅读全文
posted @ 2015-11-03 18:03 MrBlue 阅读(2275) 评论(0) 推荐(0) 编辑
摘要: 直接贴代码了using UnityEngine; using System;using System.Collections;using System;using DataTable;public class ObjDropItem : ObjBase { //类型 public override ... 阅读全文
posted @ 2015-10-28 11:07 MrBlue 阅读(1170) 评论(0) 推荐(0) 编辑
摘要: TerrainHeightProcesser 地形高度存储工具TerrainHeightData 地形高度数据// classTerrainHeightProcesserusing UnityEngine;using System.Collections;using System.IO;using ... 阅读全文
posted @ 2015-09-15 11:43 MrBlue 阅读(1944) 评论(0) 推荐(0) 编辑
摘要: 前提:1) 有个一个现成的web服务器,我用是nodejs。2) 有个能在用你手机安装的ipa3) 有个github账号开搞:1、用http://plist.iosdev.top/plisthelper.php/Index/makePlist生成一个plist文件,请确保里面的内容的正确性,用你的w... 阅读全文
posted @ 2015-08-31 16:23 MrBlue 阅读(2716) 评论(0) 推荐(0) 编辑
摘要: 正面UI添加一个TweenRotation组件,取消掉Active状态 ,To参数改成0,90,0)背面UI添加一个TweenRotation组件,取消掉Active状态,From参数改成0,270,0;To参数改成0,360,0),翻牌按钮1添加PlayTween组件 ,将正面UI拖拽到Tween... 阅读全文
posted @ 2015-08-24 15:21 MrBlue 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1.隐藏文件夹以.开头的文件夹会被Unity忽略。在这种文件夹中的资源不会被导入,脚本不会被编译。也不会出现在Project视图中。2.Standard Assets在这个文件夹中的脚本最先被编译。这个文件夹中的脚本会被导出到Assembly-CSharp-firstpass, Assembly-U... 阅读全文
posted @ 2015-07-31 15:08 MrBlue 阅读(1741) 评论(0) 推荐(0) 编辑