public UGuiComponentClone() { if (UGuiComponentClone.catch_type != null && UGuiComponentClone.catch_type == base.GetType()) { UGuiComponentClone.catch_object = this; } }
private static UGuiComponent FetchCatch() { UGuiComponent result = UGuiComponentClone.catch_object; UGuiComponentClone.catch_type = null; UGuiComponentClone.catch_object = null; return(result); }
public UGuiComponent Clone() { UGuiComponentClone.SetCatch(base.GetType()); GameObject gameObject = UGuiComponentClone.AddChild(base.gameObject.transform.parent.gameObject, base.gameObject); UGuiComponent result; if (gameObject == null) { result = null; } else { UGuiComponent UGuiForm = UGuiComponentClone.FetchCatch(); if (UGuiForm != null) { UGuiForm.DoInitIfDont(); result = UGuiForm; } else { UGuiComponent UGuiForm2 = gameObject.GetComponent(base.GetType()) as UGuiComponent; if (UGuiForm2 != null) { Debug.Log("***** Clone GetComponent called"); UGuiForm2.DoInitIfDont(); result = UGuiForm2; } else { UGuiForm2 = (gameObject.AddComponent(base.GetType()) as UGuiComponent); if (UGuiForm2 != null) { UGuiForm2.DoInitIfDont(); } result = UGuiForm2; } } } return(result); }