public GameObject CloneRoot(string name, GameObject parent) { if (this.root == null) { return(null); } GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.root); gameObject.layer = parent.layer; UXUtils.AppendNameRecursively(gameObject, name, true); gameObject.SetActive(true); gameObject.transform.parent = parent.transform; gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localScale = Vector3.one; return(gameObject); }