- 最后登录
- 2021-7-6
- 注册时间
- 2012-12-27
- 阅读权限
- 90
- 积分
- 76145
- 纳金币
- 53488
- 精华
- 316
|
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), "正在烘焙……");
}
}
第一次用,点击按钮没效果,是不是还有神马参数没有设置! 求高手解答 |
|