unity官方文档笔记

说明:
    摘录unity官方文档中值得注意的细节

1.Reducing the file size of your build

    Unity strips most unused Assets during the build, so you don’t gain anything by manually removing Assets from the Project. The only Assets that are not removed are scripts (which are generally very small anyway) and Assets in the Resources folder (because Unity can’t determine which of these are needed and which are not). With this in mind, you should make sure that the only Assets in the Resources folder are the ones you need for the game. You might be able to replace Assets in the Resources folder with AssetBundles - this means that Unity loads Assets dynamically, thereby reducing the player size.
    注意resource文件夹和script脚本,其他的资源unity打包的时候会自动处理是否包含进包内
    'most unused asset':自定义的shader文件打包的时候不会自动包含进去,需要在graphic setting里包含  

2.Publishing Builds:Preloading

    Published builds automatically preload all assets in a scene when the scene loads. The exception to this rule is scene 0. This is because the first scene is usually a splashscreen, which you want to display as quickly as possible.  
    To make sure all your content is preloaded, you can create an empty scene which calls Application.LoadLevel(1). In the build settings make this empty scene’s index 0. All subsequent levels will be preloaded.
    unity中的场景除了第一个scene不会预先加载资源,其他都可以,所以建议第一个scene为空
    当加载一个scene的时候,会预先加载这个scene里的资源(好假,你是怎么知道我下一个要加载哪个scene,unity大哥)!   

3.Sorting Group

To use the Sorting Group component, add it to the GameObject’s root (the parent GameObject of all the GameObjects you want to apply group sorting to). Select the GameObject’s root, then in the main menu select Component > Rendering > Sorting Group.
Property Function
Sorting LayerUse the drop-down to select the Layer used to define this Sprite’s overlay priority during rendering.
Order in LayerSet the overlay priority of this Sprite within its layer. Lower numbers are rendered first, and subsequent numbers overlay those below.

只适用于Spriter(二哈歪舌头)

4.Execution Order of Event Functions:

Script Lifecycle Flowchart:

这里写图片描述

unity框架MonoBehaviour所有可执行的接口.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值