纳金网
标题:
脚本烘焙 Lightmapping.Bake怎么使用
[打印本页]
作者:
烟雨
时间:
2013-6-15 03:12
标题:
脚本烘焙 Lightmapping.Bake怎么使用
void OnGUI()
{
if (GUI.Button(new Rect(10, 10, 100, 30), "烘焙"))
{
UnityEditor.LightmapEditorSettings.skyLightIntensity = 0.24f;
UnityEditor.LightmapEditorSettings.bounceBoost = 1;
UnityEditor.LightmapEditorSettings.bounceIntensity = 1;
UnityEditor.LightmapEditorSettings.finalGatherRays = 100;
UnityEditor.LightmapEditorSettings.lockAtlas = false;
if (UnityEditor.Lightmapping.Bake())
{
Debug.Log("执行");
GUI.Label(new Rect(400, 400, 100, 30), "烘焙成功");
}
}
if (UnityEditor.Lightmapping.isRunning)
{
GUI.Label(new Rect(400, 400, 100, 30), "正在烘焙……");
}
}
第一次用,点击按钮没效果,是不是还有神马参数没有设置! 求高手解答
欢迎光临 纳金网 (http://rs.narkii.com/club/)
Powered by Discuz! X2.5