Resources.FindObjectsOfTypeAll<T>()的坑(Ghost prefab)
2015-03-11 20:04
459 查看
今天遇到了一个Bug,因为调用Resources.FindObjectsOfTypeAll<T>()遍历整个场景,结果遍历出的对象不对。比较哈希一查果然是两个。原来prefab本身和prefab生成对象都在场景里。
那么如何区别是不是prefab,官方论坛没有比较好的解释LINK
我采用的方法是用放到某个层级下,而不是根目录
那么如何区别是不是prefab,官方论坛没有比较好的解释LINK
我采用的方法是用放到某个层级下,而不是根目录
相关文章推荐
- 在Unity内制作工具(1)--MenuItem,Resouces.FindObjectsofTypeAll<>与EditorWindow自制编辑器窗口
- Resources.FindObjectsOfTypeAll过滤掉预设体的方法
- Transform.Find();,FindObjectOfType<>();,GetComponent<>()
- 写ArrayList随手出现No enclosing instance of type <program name> is accessible
- type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object
- The entity type <type> is not part of the model for the current context
- 使用Enumerable.OfType<T>扩展方法实现非泛型集合的Linq查询
- Enumerable.All<(Of <(TSource>)>) 方法
- <mvc:resources mapping="/js/**" location="/js/**"/> <script type="text/javascript" src="<%=reques
- 解决“could not find gem 'turn <>=0 ' in any of the gem sources listed in your gemfile”错误
- Sending 'xxx *const __strong' to parameter of incompatible type 'id<aDelegate>'
- Sending 'ViewController *const __strong' to parameter of incompatible type 'id<***Delegate>'
- 窗体Controls的OfType<>方法的使用
- 窗体Controls的OfType<>方法的使用
- LinQ转换运算符OfType<T>
- 算法之旅,直奔<algorithm>之一 all_of
- 桑心啊,List<T>.FindAll()的效率竟然比for循环还差。
- android项目报错 org.JSONException:Value<html><head><title>Apache of type java.lang.String.
- Sending 'ViewController' to Parameter of Incompatible Type 'id<xxxDelegate>'
- 解决SPSS Modeler sql data type out of range<-25>报错