Animator状态快速切换问题
摘要:【Animator状态快速切换问题】 事情是这样的,我尝试在一帧内多次切换一些状态(当前状态为Idle的情况下): 但结果并非播放Idle,而是播放BeAttack1。 在调用Play前,调用一次Update即可。 参考:https://i.cnblogs.com/EditPosts.aspx?op
阅读全文
Mesh.CombineMeshes
摘要:【Mesh.CombineMeshes】 public void CombineMeshes(CombineInstance[] combine, bool mergeSubMeshes = true, bool useMatrices = true, boolhasLightmapData = f
阅读全文
AssetBundle Manager
摘要:【AssetBundle Manager】 AssetBundleManager是一个款Unity公司制作的Unity库。 1、Simulation Mode The main advantage of using Simulation Mode is that Assets can be modi
阅读全文
Loading AssetBundle Manifests
摘要:【Loading AssetBundle Manifests】 AssetBundle Manifest 可以用于获取dependency。 使用 GetAllDependencies 方法加载所有依赖 【unload】 AssetBundle.Unload(bool); and if you sh
阅读全文
Loading Assets from AssetBundles
摘要:【Loading Assets from AssetBundles】 1、LoadAsset 2、LoadAssetAsync 3、LoadAllAssets 4、LoadAllAssetsAsync
阅读全文
加载 AssetBundle 的四种方法
摘要:【加载 AssetBundle 的四种方法】 1、AssetBundle.LoadFromMemoryAsync(byte[] binary, uint crc = 0); 返回AssetBundleCreateRequest.Use assetBundle property to get an A
阅读全文
Path-O-LOGIC Keynote
摘要:【Path-O-LOGIC Keynote】 1、 OnSpawned()OnSpawned(SpawnPool pool) 2、 OnDespawned()OnDespawned(SpawnPool pool) 3、PoolManager只有一个类成员 4、PoolManager.Pools[]
阅读全文
Unity加载二进制数据
摘要:【Unity加载二进制数据】 The first step is to save your binary data file with the ".bytes" extension.unitywill treat this file as aTextAsset. As a TextAsset th...
阅读全文
Graphics.Blit
摘要:【Graphics.Blit】 需求注意第4个参数,用4个参数pass用于指定使用哪一个pass。默认值为-1,即使用所有的pass。 参考:file:///C:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/html/en/...
阅读全文
Shader.WarmupAllShaders
摘要:【Shader.WarmupAllShaders】
阅读全文
Graphics.BlitMultiTap解析
摘要:【Graphics.BlitMultiTap解析】 上述代码的四个偏移,表示利用此4个偏移,生成4张纹理单位。下面每一个SetTexture,默认会调用一个纹理单位。 而在Shader中,Unity会默认把此偏移设值为:half4 _BlurOffsets; 变量。 _MainTex_...
阅读全文
MonoBehaviour.OnValidate
摘要:【MonoBehaviour.OnValidate】 This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only). 脚本被...
阅读全文
UnityEngine.SerializeField & System.Serializable
摘要:【UnityEngine.SerializeField】 Force Unity to serialize a private field. 强制Unity序列化一个私有变量。 You will almost never need this. When Unity serializes you...
阅读全文
Unity协程使用经验
摘要:【Unity协程使用经验】 1、协程的好处是,异步操作发起的地方和结束的地方可以统一在一个方法,这样就不用引入额外的成员变量来进行状态同步。 2、在一个协程中,StartCoroutine()和 yield return StartCoroutine()是不一样的。 前者仅仅是开始一个新的Corou
阅读全文
Camera & Render
摘要:1、voidRender();Description Render the camera manually.This will render the camera. It will use the camera's clear flags, target texture and all other...
阅读全文
Unity Pitfall 汇总
摘要:【Unity Pitfall 汇总】1、 当脚本被绑定到一个对象时,一个类对象即会被创建,此意味着此类构造函数会被调用。所以在构造函数中不要调用任何运行时才创建的类。相应的初始化方代码应该移至Start方法中。2、需使用UNITY_EDITOR宏来避免在编辑器中调用构造函数。 3、Start()的...
阅读全文
ExecuteInEditMode
摘要:【ExecuteInEditMode】 当我们为MonoBehavior定义了[ExecuteInEditMode]后,我们需要关心Awake和Start在编辑器中的执行状况。 1、当该MonoBehavior在编辑器中被赋于给GameObject的时候,Awake, Start 将被执行。 ...
阅读全文
判断当前Selection是否为prefab
摘要:【判断当前Selection是否为prefab】PrefabUtility.GetPrefabParent(target) == null && PrefabUtility.GetPrefabObject(target) != null参考:file://localhost/Applications...
阅读全文
AddComponentMenu
摘要:【AddComponentMenu】 The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu. AddComponentMenu用于方便地添加方法。参考:file...
阅读全文
MenuItem属性
摘要:【MenuItem属性】 The MenuItem attribute allows you to add menu items to the main menu.The MenuItem attribute turns any static function into a menu comman...
阅读全文