Hi,
Is there any way to tell from a script which lod is currently active?
I thought maybe the renderer or the gameobject was being disabled/enabled by the lod group. So I hoped that if I added a script like this to the gameobjects in the lod group, I might be able to monitor whether they are active or not…but it doesn’t work…
Is there any way to do this?
public class ThisLodIsEnabled : MonoBehaviour
{
private Renderer renderer;
private void Start()
{
renderer = GetComponent<Renderer>();
}
//private void OnEnable()
//{
// Debug.Log(gameObject.name + "I AM ENABLED");
//}
//private void OnDisable()
//{
// Debug.Log(" TMC I AM DISABLED");
//}
private void Update()
{
if (renderer.enabled)
{
Debug.Log(gameObject.name + "I AM ENABLED");
}
else
{
Debug.Log(gameObject.name + "I AM DISABLED");
}
}
}