c# - 当前 LOD 级别 - LOD Group Unity

标签 c# unity3d level-of-detail

我无法引导 LOD 组,因为我想知道我在屏幕上看到的当前事件 LOD 级别。我只能通过

访问百分比
GameObject.GetComponent<LODGroup>().GetLODs()[size].screenRelativeTransitionHeight;

有人知道怎么解决吗?提前致谢。

最佳答案

通过搜索 answers.unity3d.com 的答案,我得出以下结论: http://answers.unity3d.com/questions/684467/find-the-lod-step-which-is-currently-used.html

 LODGroup lodGroup = obj.GetComponent<LODGroup>();
 if (lodGroup != null)
 {
     Transform lodTransform = lodGroup.transform;
     foreach (Transform child in lodTransform)
     {
         var renderer = child.GetComponent<Renderer> ();
         if (renderer != null && renderer.isVisible)
         { 
             Debug.Log("This LODlevel is used: " + child.name); 
         }
     }
 }

您可以通过查看当前可见(在屏幕上可见)的子游戏对象渲染器的名称来找出当前处于事件状态的 LOD 级别。

关于c# - 当前 LOD 级别 - LOD Group Unity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37755510/

相关文章:

c# - 我如何在 Ubuntu 中使用 Visual Studio Code 开发 Unity3D 项目

3d - 远距离 3D 对象渲染 [游戏]

c# - IHttpClientFactory 的解析服务在 Azure 函数上失败

c# - 如何使用 asp.net 在 web 服务中获取请求的 url?

ios - 从 unity 3 升级后,Xcode 无法解析从 Unity 4 导出的项目

r - 表格 : How can I measure similarity of sets of dimensions across dates?

algorithm - 来自两个输入的伪随机数生成器

c# 执行命令行并返回字符串

c# - DataGrid WPF StackOverFlow 异常

c# - 命名 MonoBehaviour 类 GameManager 时的特殊图标