汇总_开发者酒馆-不定期坑新

来源:互联网 发布:sql%20server%202000 编辑:程序博客网 时间:2024/04/28 10:27

汇总_开发者酒馆-不定期坑新

===============Editor专栏===============
1_
问:在Editor模式下显示模型的预览
答:t2d = AssetPreview.GetAssetPreview(obj);

2_
问:在Editor模式怎么获取一个物体的属性阿
答:GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/GameObject.prefab");

3_
问:有没有在不写 EditorInspector的情况下,把变量名 改成 备注自定义信息?[Tooltips(“XXXX”)]这个只能悬浮备注
答:变通一下吧,[HeaderAttribute(“XXXX”)]这样行不行?

4_
问:没运行 如何获取当前场景名称
答:

public static string GetCurrentEditSceneName(){  string[] names = EditorApplication.currentScene.Split('/');  string fullName = names[names.Length - 1];  return fullName.Replace(".unity", "");}

===============报错专栏===============
1_
问:
这是什么情况

Fatal error!Could not allocate memory: system out of memory!Trying to allocate: XXXXXXXXXXXXX with X alignment. MemoryLable:NewDeleteAllocation happend at: Line: X in Overloaded NewMemory overview

答:system out of memory,内存溢出
再问:- -。哎。12G的内存都能溢出 真是够了。
答:你是不是 4.6,肯定是。4.X 是32位,最大只支持 3.5G 你12G也没用

===============代码逻辑专栏===============
1_
问:lua里面对一个{a=3,b=2,c=4,d=1}这种格式的table排序怎么做?
答:先把a,b,c,d提出来建一个新的table,排好序,再遍历这个新table依次取值

……_waiting…

1 0