示例#1
0
        //Uity52で発生したエラー対応
        static void VersionUpSceneToUnity52(AdvEngine engine)
        {
            //Graphicのないマスクコンポーネントを削除
            List <Mask> maskList = new List <Mask>();

            foreach (Mask mask in engine.GetComponentsInChildren <Mask>(true))
            {
                if (mask.GetComponents <Graphic>().Length <= 0)
                {
                    maskList.Add(mask);
                }
            }

            //ScrollBarとScrollRectの重複を削除
            List <Scrollbar> scrollbarList = new List <Scrollbar>();

            foreach (Scrollbar scrollbar in engine.GetComponentsInChildren <Scrollbar>(true))
            {
                if (scrollbar.GetComponent <ScrollRect>() != null)
                {
                    scrollbarList.Add(scrollbar);
                }
            }

            if (scrollbarList.Count > 0 || maskList.Count > 0)
            {
                if (EditorUtility.DisplayDialog(
                        "UTAGE Version Up Scene"
                        , LanguageSystemText.LocalizeText(SystemText.VersionUpScene)
                        , LanguageSystemText.LocalizeText(SystemText.Yes)
                        , "Cancel")
                    )
                {
                    foreach (var item in scrollbarList)
                    {
                        Object.DestroyImmediate(item);
                    }
                    foreach (var item in maskList)
                    {
                        Object.DestroyImmediate(item);
                    }
                    WrapperUnityVersion.SaveScene();
                }
            }
        }
示例#2
0
        //Uity52で発生したエラー対応
        static bool CheckVersionUpSceneToUnity52(AdvEngine engine)
        {
            //Graphicのないマスクコンポーネントを削除
            foreach (Mask mask in engine.GetComponentsInChildren <Mask>(true))
            {
                if (mask.GetComponents <Graphic>().Length <= 0)
                {
                    return(true);
                }
            }

            //ScrollBarとScrollRectの重複を削除
            foreach (Scrollbar scrollbar in engine.GetComponentsInChildren <Scrollbar>(true))
            {
                if (scrollbar.GetComponent <ScrollRect>() != null)
                {
                    return(true);
                }
            }

            return(false);
        }