1. Raycast 没有效果
通过collider的射线收集碰撞体,没有效果,不知道为什么?
Ray ray = new Ray {
origin = transform.position,
direction = transform.forward
};
RaycastHit hit;
ray.direction = ray.direction * 100;
if(transform.GetComponent<Collider>().Raycast(ray, out hit, 20000))
{
Debug.Log("hit = yes"));
}
但是通过 Physics射线收集就有效果
var hits = Physics.RaycastAll(ray, 10);
if (hits != null && hits.Length > 0)
{
Debug.Log("log="+hits[0].collider.name);
}
2. SceneManager.loadSceneAsyn其实这行代码卡住很久时间(仅在editor中卡),在release包之后才正常。
3. 在edit模式中,使用PrefabUtility.InstantiatePrefab去实例化prefab,这样才能真正关联prefab,否则使用instantiate方法去实例化的话,在编辑器中会产生一个全新的不关联的对象。
4。有时候粒子系统显示不出来,