public void ValidateRoot() { uiExtension = GetComponent <BaseUIExtension>(); if (uiExtension != null) { uiExtension.ui = this; } if (root == null) { root = gameObject; } }