- 最后登录
- 2014-10-23
- 注册时间
- 2011-7-19
- 阅读权限
- 90
- 积分
- 81303
![Rank: 8](static/image/common//star_level3.gif) ![Rank: 8](static/image/common//star_level3.gif)
- 纳金币
- -1
- 精华
- 11
|
Where possible ditch the OO principle of having behaviour scripts on your game objects. Instead have one central script in which you update your game action. The fewer the update functions the better. OOP is great if you want to share and re-use code - but is slower to write and***n. In my experience. On low end devices procedural programming is often where it's at.
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 13.0px Helvetica; color: #101010} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 13.0px Helvetica; color: #101010; min-height: 16.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 12.0px; font: 12.0px Courier; color: #101010; background-color: #f2f6f8} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 13.0px Helvetica; color: #35393f}
Use mesh/game object combining where possible to save draw calls.
Try to avoid loading/instantiating resources for the first time during gameplay - if possible instantiate them once before the game play starts, destroy them and thereafter they will be quicker to instantiate.
Avoid lighting/lights.
Code:
for (i=0; i<myarray.length; i++) {
}
is slower than:
Code:
arraylen = myarray. length;
for (i=0; i< arraylen; i++) {
}
Stinkbots XCode tweak is awesome:
http://f***m.unity3d.com/viewtopic.php?t=24987
If you're not using the accelerometer at least lower it's frequency of update in XCode.
Instead of checking the count var in GLOB.js use invoked functions e.g. to update an enemy count or NPC status every n seconds. |
|