Hi,
I got a camera attached to a disabled game object.
When the root object is instantiated I enable the game object, but the camera is disabled.
There is only 3 references to the camera.
The first one is the declaration and here are the to others :
public void OnEnable()
{
Debug.Log("OnEnable " + transform.root.gameObject.name);
m_Camera.enabled = true;
MeshRenderer renderer = m_HudMesh.GetComponent<MeshRenderer>();
renderer.enabled = true;
}
public void OnDisable()
{
Debug.Log("OnDisable " + transform.root.gameObject.name);
m_Camera.enabled = false;
MeshRenderer renderer = m_HudMesh.GetComponent<MeshRenderer>();
renderer.enabled = false;
}
Defaut inspector (not ingame)
Ingame inspector (the camera is disabled):