protected void ChangeCurved3DCanvas() { if (isActiveAndEnabled) { var curretCurvedCanvas = GetValidCurved3DCanvas(); if (curretCurvedCanvas != m_curvedCanvas) { if (m_curvedCanvas != null) { m_curvedCanvas.RemoveElement(this); } m_curvedCanvas = curretCurvedCanvas; if (m_curvedCanvas != null) { m_curvedCanvas.AddElement(this); } } } else { if (m_curvedCanvas != null) { m_curvedCanvas.RemoveElement(this); } m_curvedCanvas = null; } }
protected override void OnEnable() { base.OnEnable(); m_curvedCanvas = GetValidCurved3DCanvas(); if (m_curvedCanvas != null) { m_curvedCanvas.AddElement(this); } }