コード例 #1
0
ファイル: UGuiComponentClone.cs プロジェクト: unstephen/Q3
 public UGuiComponentClone()
 {
     if (UGuiComponentClone.catch_type != null && UGuiComponentClone.catch_type == base.GetType())
     {
         UGuiComponentClone.catch_object = this;
     }
 }
コード例 #2
0
ファイル: UGuiComponentClone.cs プロジェクト: unstephen/Q3
        private static UGuiComponent FetchCatch()
        {
            UGuiComponent result = UGuiComponentClone.catch_object;

            UGuiComponentClone.catch_type   = null;
            UGuiComponentClone.catch_object = null;
            return(result);
        }
コード例 #3
0
ファイル: UGuiComponentClone.cs プロジェクト: unstephen/Q3
        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);
        }