自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

xak的专栏

Sometimes when I look at the world, I can see a line behind it.

原创 NGUI字体贴图压缩以及相关Shader解读

一般游戏中,字体贴图是游戏贴图压缩的一个重点,特别是对于中文的游戏。考虑的字体贴图的特殊性,一般我们输出的字体贴图是不含颜色信息的,所以正常情况下,我们输出的字体贴图RGBA每个通道都是一样的。这样一来,就存在很大的浪费。所以我们可以在RGBA四个通道中可以保存不同的字体。

2014-08-26 15:24:28 1866

原创 Missing prefab warn when delete the prefab

Is there a way to break a prefab connection through the editor? IfI delete the prefab, the instance of it turns red and seems to wantthe underlying prefab restored. As it is, the only option seems t

2014-08-22 11:56:14 1451

转载 Rendering Paths

Unity supports different Rendering Paths. You shouldchoose which one you use depending on your game content and targetplatform / hardware. Different rendering paths have differentfeatures and perfo

2014-08-22 11:56:12 623

原创 What is the function MultiplyUV() in shader?

I suspect that Unity uses it to apply the offset and scale set inthe Material. (like tiling,Offset )

2014-08-22 11:56:08 1634 1

原创 2D occlusion culling

Ask:In my 2D game, I have static and dynamic objects. There can bemultiple cameras. My problem:Determineobjects that intersect with the current camera's viewrectangle.Currently, I simply iterat

2014-08-22 11:56:01 602

原创 Rect setCenter must after setSize

When setSize of the rect,the center of the rect will be changed.soyou need to setCenter after setSize.(Just because the size's scaleis relative to left-bottom)

2014-08-22 11:55:59 875

原创 Use legacy animation system in Unity

1.For imported animationIf you're using the Animation component,you need to import the rig as Legacy.If you import the rig as Humanaoid, you need to use anAnimator component (Mecanim) and an Anima

2014-08-22 11:55:51 960

转载 ScriptableObject[Unity]

ScriptableObject is a class that allows you to store largequantities of shared data independent from script instances. Do notconfuse this class with the similarly named SerializableObject,which is

2014-08-22 11:55:44 1231

转载 Special Folders and Script Compilation Order [Unity]

For the most part, you can choose any names you like for thefolders in your project but Unity reserves some names to indicatethat the contents have a special purpose. Some of these foldershave an e

2014-08-22 11:55:42 837

转载 A*算法、导航网格、路径点寻路对比(A-Star VS NavMesh VS WayPoint)

在Unity3d中,我们一般常用的寻路算法:1.A*算法插件与贪婪算法不一样,贪婪算法适合动态规划,寻找局部最优解,不保证最优解。A*是静态网格中求解最短路最有效的方法。也是耗时的算法,不宜寻路频繁的场合。一般来说适合需求精确的场合。与启发式的搜索一样,能够根据改变网格密度、网格耗散来进行调整精确度。使用较好的地方:a.策略游戏的策略搜索b.方块格子游戏中的

2014-08-22 11:55:40 5666

转载 Building AssetBundles

Building AssetBundlesThere are three class methods you can use to buildAssetBundles:BuildPipeline.BuildAssetBundle allowsyou to build AssetBundles of any type of asset.BuildPipeline.BuildS

2014-08-22 11:55:31 1186

转载 Managing asset dependencies

Managing asset dependenciesAny given asset in a bundle may depend on other assets. Forexample, a model may incorporate materials which in turn make useof textures and shaders. It is possible to

2014-08-22 11:55:26 774

转载 内存耗用:VSS/RSS/PSS/USS

内存耗用:VSS/RSS/PSS/USSTerms VSS - Virtual Set Size虚拟耗用内存(包含共享库占用的内存)RSS - Resident Set Size实际使用物理内存(包含共享库占用的内存)PSS - Proportional Set Size实际使用的物理内存(比例分配共享库占用的内存)USS - Unique Set Size进程独

2014-08-22 11:55:24 1013

转载 给CodeIgniter增加Redis的缓存驱动

http://codeigniter.org.cn/forums/thread-17108-1-1.htmlRedis目前是越来越火了,但是CodeIgniter2默认不支持Redis,在github上发现CodeIgniter官方把该功能放到了3.0里。想使用Redis的朋友可以自己新增一个缓存驱动,方法如下:1、将system\libraries\Cache\Cache.

2014-08-22 11:55:22 2511

转载 MMOG网络同步算法揭秘(QQ幻想)

游戏发展从单机游戏到局域网游戏再到mmog(Massive multiplayer online game,即大型多人在线游戏),越来越强调玩家之间的互动。mmog形成互动的前提是游戏中的所有玩家认为他们是在同一个游戏世界中,然而这个同一个游戏世界真的存在吗?答案是否定的,实际上,从不同的维度看,mmog中存在3种不同世界:  真实世界,也就是mmog服务器推演的游戏世界;  玩家自己的

2014-08-22 11:55:20 1006

转载 游戏网络同步——MMO位置同步

前提1.client和server之间或多或少存在网络延迟,需要提前做好对时,并在网络环境发生变化时校正时差。国内的公网通信,非跨网的情况下,一般在120ms左右。本地的网络会好一些。2. 要努力防止外挂,如果是以client的通知为主,也要做抽查,或者全部都校验。3. 应用DR技术,在没有收到位置更新包的同时,client视野中的其他client按照游戏规则运动。4. 控制位置同步的

2014-08-22 11:55:16 6623 1

转载 游戏网络同步——dead reckoning

网游中,玩家的位置同步经常会用到deadreckoning算法,中文翻译叫导航推测,下文简称DR。DR提供了隐藏延时和减少带宽的方法。DR在本地模拟其他联网玩家状态(主要是位置信息),减少网络带宽消耗的同时尽可能的还原实际情况。在飞机游戏中DR的一个例子:1. 飞机的运动速度都是固定的,两台游戏机联机玩,分别是A和B;2. 对于A和B来说,是否需要发送PDU(protocoldat

2014-08-22 11:55:13 3146 1

原创 Shader Level of Detail

In a shader, you can specify different subshaders with differentLOD attributes.Code (csharp):    SubShader {       LOD 200       Pass {//insert shader pass here   

2014-08-22 11:55:05 1058

转载 C++中引用OC类

问题描述:使用OC封装了GameCenter的一些特性,然后在一个.mm的工具类中引用OC封装的工具类(在mm文件对应的.h中引用)。然后所有引用这个mm的.cpp文件会报错。问题分析:循环应用之后,导致纯C++的头文件中引用了OC的头文件原因:对于预处理器而言,它只做文本的替换操作。所以#include和#import本质上就是递归地复制和粘贴引用文件的内容。所以当循环引用替换之后,会在c

2014-08-22 11:54:54 2818 2

转载 How to Submit Your App When it Uses IDFA

On April 11th, Applereleased updated guidelines for iTunes Connecton how app developers can use IFA (IDFA). Accordingly, we addressthese new guidelines in respect to the use of MobileAppTracking an

2014-08-22 11:54:49 891

转载 各种移动GPU压缩纹理的使用方法

介绍了各种移动设备所使用的GPU,以及各个GPU所支持的压缩纹理的格式和使用方法。1.移动GPU大全目前移动市场的GPU主要有四大厂商系列:1)Imagination Technologies的PowerVR SGX系列   代表型号:PowerVR SGX 535、PowerVR SGX540、PowerVR SGX 543MP、PowerVR SGX 554MP等代表

2014-08-22 11:54:43 611

转载 Unity3D脚本批量打包

最近在研究Unity3D脚本批量打包,比如在Android平台下各种不同分辨率和不同内存大小的机器,可能还有不同的渠道包,不同渠道可能用的SDK都不一样,这一切的一切都表明你的代码无法做到自适应的,除非批量打包提供各个平台的预定义标签#define。Unity默认提供了一些预定义标签如:UNITY_EDITOR  : 编辑器模式下。UNITY_STANDALONE:PC Mac Li

2014-08-22 11:54:39 1296

转载 2D Blending-Unity Animator

The first option in the Inspector ofa Blend Node is theThe Blend Type. This drop-down is used toselect one of the different blend types that can blend according toone or two parameters. The 2D ble

2014-08-22 11:54:34 649

原创 Create separate Anim file from fbx in Unity

I finally found the answer,pressing CTRL+D onanimation clip in .fbx file will create a separate .anim file, whata strange operation!

2014-08-22 11:54:28 705

转载 General Performance Tips-Unity

Official Tips fromOverTheEdgeOptimizing Graphics PerformanceReducing File SizeCharacter Animation (Tips areinterspersed.)GeneralTips on OptimizationProfilefirst. Don't spend time tryin

2014-08-22 11:54:26 491

转载 Optimise Shadows In Unity

There are a few things you should do to optimise the shadows inyour game:Use lightmapping heavily to compute the shadows for static meshes.Unity has a builtin lightmapper. See http://docs.unity3d.

2014-08-22 11:54:23 372

转载 Unity编译至Xcode工程后自动添加文件和库的方法

为什么想要自动添加由于Unity是全平台的游戏开发环境,在开发中针对特定平台的特定功能时,很难避免根据对象平台的不同而引入不同的依赖。包括源码,需要的库和框架等。在使用各种插件后这种情况愈发严重:比如想加入内购功能,StroreKit.framework必不可少,而且也需要相应的处理代码。按照一般的Unity插件开发流程,在完成.cs的接口声明和Unity侧的调用实现后,最重要的当然是在iOS

2014-08-22 11:54:21 1005

转载 Split Png Aplha Channel

////// Split PNG file into two JPGs (RGB and alpha)///private voidSplitPngFileIntoRGBandAplha(string imagePath){    try    {       // Open originalbitmap       var bitmap = new Bit

2014-08-22 11:54:19 642

原创 OnEnable, Awake, Start order

关于游戏中游戏对象是否处于active或者脚本是否为enabled 时Start和Awake函数的调用基本上可以有四种情况:1.game object 为active 但是脚本为disabled此时当对象被创建时只有Awake函数会被立刻调用,OnEnable和 Start会在Enabled脚本后调用。2.game object 为deactive但是脚本为enable

2014-08-22 11:54:17 1457

原创 3 ways to draw 3d lines in unity3d

ways to draw 3d lines in unity3d" TITLE="3 ways to draw 3d lines in unity3d" />Just as I was thinking about an interesting demo to play withdrawing functions in Unity3D,Mrdoob publishedhis Harmon

2014-08-22 11:54:13 1867

原创 Custom Editor losing settings on Play

All the scripts which inherit from MonoBehaviour are serializable,but your custom classes are not. To inform unity that you want yourclass to be serialized you have to use the [System.Serializable]

2014-08-22 11:54:10 517

转载 46 Tips & Tricks for 2D mobile Performance in Unity

If this is your first jump into the world of Unity, my firsttip (this one’s a freebie) is to stop trying to use it like otherlanguages and environments. You will be using GameObjects, you willbe ad

2014-08-22 11:54:08 1514

原创 用例中的前置条件和后置条件

A preconditions section definesall the conditions that must be true (i.e., describes the state ofthe system) for the trigger to meaningfully cause the initiation ofthe use casePost-conditions ar

2014-08-22 11:54:04 16729

转载 Draw Call Batching

To draw an object on the screen, the engine has to issue a drawcall to the graphics API (e.g. OpenGL or Direct3D). The graphicsAPI does significant work for every draw call, causing performanceover

2014-08-22 11:54:02 868

原创 Occlusion Culling-Unity

Occlusion Culling (Pro only)Occlusion Culling is a feature that disables rendering of objectswhen they are not currently seen by the camera because they areobscured by other objects. This does not

2014-08-22 11:54:00 1126

原创 Unity3D里的碰撞检测

Unity3D里两个碰撞体之间发生碰撞可以用OnCollision族函数和OnTrigger族函数来获知和处理。Unity官方给出了两张可发生碰撞的组合表: Collision detection occurs and messages are sent uponcollision Static ColliderRigidbody ColliderKinema

2014-08-22 11:53:56 1916

原创 svn branch merge tree conflict issue (using tortoise)

http://stackoverflow.com/questions/16367990/svn-branch-merge-tree-conflict-issue-using-tortoiseI have read a lot and lot on this but couldn't figure out what theissue is, and it's pretty weird. I a

2014-08-22 11:53:54 1501

转载 C#中的委托和事件

文中代码在VS2005下通过,由于VS2003(.Net Framework1.1)不支持隐式的委托变量,所以如果在一个接受委托类型的位置直接赋予方法名,在VS2003下会报错,解决办法是显式的创建一个委托类型的实例(委托变量)。例如:委托类型委托实例 = new 委托类型(方法名); 欢迎浏览本文的后续文章: C#中的委托和事件(续) 引言委托 和 事件在 .Net

2014-08-22 11:53:49 391

原创 模拟器 INSTALL_FAILED_CONTAINER_ERROR

解决方案:找到项目下AndroidManifest.xml文件中的manifest标签,里面有个属性是android:installLocation的属性,我之前为了节约手机的内存空间把值设置成了preferExternal,只要改成auto就可以了。

2014-08-22 11:53:47 821

原创 wordpress出现数据库连接错误解决方案

wordpress出现数据库连接错误,登陆wp-admin提示修复数据库,进入phpmyadmin发现wp-option损坏,提示:Tableis marked as crashed, problems with repairing thetable。解决办法:登陆mysql控制台,输入myisamchk -r wp_options ,如果提示内存不够(eg:myisamchkerror

2014-08-22 11:53:43 1234

提示
确定要删除当前文章?
取消 删除