摘要: usingUnityEngine;usingSystem.Collections;publicclassCameraController:MonoBehaviour{publicfloatbackgoundWidthInpixel;//UsethisforinitializationvoidStart(){floatbackgoundWidth=backgoundWidthInpixel/100;//100isthepixelstounitvaluefloatretio=(float)(Screen.width)/(float)(Screen.height);floatnewSize=bac. 阅读全文
posted @ 2014-03-19 15:27 火之梦魇 阅读(852) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-03-06 15:18 火之梦魇 阅读(1426) 评论(0) 推荐(0) 编辑
摘要: ///Check the current device is tablet or notprivate void checkTheCurrentDevice(){#ifUNITY_IPHONEstring deviceModel = SystemInfo.deviceModel.ToLower().Trim();if(deviceModel.StartsWith("ipad")){bIsTablet = true;}else{bIsTablet = false;}#elifUNITY_ANDROIDfloat physicScreenSize = Mathf.Sqrt(Sc 阅读全文
posted @ 2014-02-21 18:25 火之梦魇 阅读(1748) 评论(0) 推荐(0) 编辑
摘要: usingUnityEngine;usingSystem.Collections;usingSystem.Collections.Generic;publicclasstest:MonoBehaviour{Texture2DalphaTest;voidStart(){alphaTest=(Texture2D)this.GetComponent().texture;Debug.Log(Screen.width+""+Screen.height);}//UpdateiscalledonceperframevoidUpdate(){if(Input.GetMouseButton( 阅读全文
posted @ 2014-02-18 16:56 火之梦魇 阅读(1198) 评论(0) 推荐(0) 编辑
摘要: Listtextures=newList();Listsprits=newList();for(inti=batch*batchQuantity;i();stringtempUrl=facebookGraphURL+"/"+fi.firendId+"/picture?access_token="+FacebookCenter.instance.GetAccessToken();if(WebTextureCache.InstantiateGlobal().ImageCache.ContainsKey(tempUrl)){if(WebTextureCache 阅读全文
posted @ 2014-02-14 14:31 火之梦魇 阅读(2960) 评论(0) 推荐(0) 编辑
摘要: 3D游戏,引擎 阅读全文
posted @ 2013-11-06 15:45 火之梦魇 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 转自:http://gamerboom.com/archives/76214作者:Amir Fasshihi流畅的游戏玩法来自流畅的帧率,而我们即将推出的动作平台游戏《Shadow Blade》已经将在标准iPhone和iPad设备上实现每秒60帧视为一个重要目标。以下是我们在紧凑的优化过程中提升游戏运行性能,并实现目标帧率时需要考虑的事项。当基本游戏功能到位时,就要确保游戏运行表现能够达标。我们衡量游戏运行表现的一个基本工具是Unity内置分析器以及Xcode分析工具。使用Unity分析器来分析设备上的运行代码真是一项宝贵的功能。我们总结了这种为将目标设备的帧率控制在60fps而进行衡量、调 阅读全文
posted @ 2013-11-05 16:21 火之梦魇 阅读(671) 评论(0) 推荐(0) 编辑
摘要: 来源:http://forum.web3dlife.com/thread-143-1-7.html官方文档在这里Optimizing Graphics Performance,里面提到的中心要点就是联结(combine),联结,再联结。而对于具体怎么联结他却略过不提,于是只好自己研究。先解释下联结的原理和意思:文档里说,显卡对于一个含100个面片的物体的和含1500个面片的物体的渲染消耗几乎是等价的。所以如果你有N个同一材质的东西,那么把他们联成同一个物体再统一用一个material那么对于显卡的渲染消耗就要降低N倍。再讲具体做法,方法有2:1、是直接在max等工具里联结好,贴上同一材质再导进 阅读全文
posted @ 2013-11-05 16:19 火之梦魇 阅读(6493) 评论(0) 推荐(0) 编辑
摘要: 2011-07-04 00:29:10|分类:[笔试面试]|标签:fps游戏服务器设计tcpudp|字号订阅一、追溯去gameloft笔试,有一个题目是说:叫你去设计一个FPS(第一人称射击游戏),你是要用TCP呢还是要用UDP,说明理由 。二、学习这是两篇网上找到的文章,写非常不错。当时笔试的时候自己没想到这么全,但大概想法都是一致的,摘录下来再学习一下。1.网络游戏程序员须知 UDP vs TCP作者:rellikt@gmail.com首发链接:http://blog.csdn.net/rellikt/archive/2010/08/21/5829020.aspx这篇教程让我们就从最基本的 阅读全文
posted @ 2013-10-15 16:13 火之梦魇 阅读(388) 评论(0) 推荐(0) 编辑
摘要: untiy 阅读全文
posted @ 2013-08-21 09:13 火之梦魇 阅读(2248) 评论(0) 推荐(0) 编辑