void OnBecameVisible() { m_vectorLine.active = true; // Draw line now, otherwise's there's a 1-frame delay before the line is actually drawn in the next LateUpdate VectorManager.DrawArrayLine(m_objectNumber.i); }
IEnumerator WaitCheck() { // Ensure that the line is drawn once even if the camera isn't moving // Otherwise this object would be invisible until the camera moves // However, the camera might not have been set up yet, so wait a frame and turn off if necessary VectorManager.DrawArrayLine(m_objectNumber.i); yield return(null); if (!GetComponent <Renderer>().isVisible) { m_vectorLine.active = false; } }