Example #1
0
        private void OnEnable()
        {
            _pageView = (SPageView)target;

            gridElement     = serializedObject.FindProperty("gridElement");
            scrollType      = serializedObject.FindProperty("_scrollType");
            row             = serializedObject.FindProperty("_row");
            column          = serializedObject.FindProperty("_column");
            horizontalSpace = serializedObject.FindProperty("_horizontalSpace");
            verticalSpace   = serializedObject.FindProperty("_verticalSpace");
            pageSpace       = serializedObject.FindProperty("_pageSpace");
            loop            = serializedObject.FindProperty("_loop");

            BackTime                  = serializedObject.FindProperty("BackTime");
            ScrollLogicDistance       = serializedObject.FindProperty("ScrollLogicDistance");
            ChangePageTime            = serializedObject.FindProperty("ChangePageTime");
            ChangePageDistancePer     = serializedObject.FindProperty("ChangePageDistancePer");
            AutoChangePageDistancePer = serializedObject.FindProperty("AutoChangePageDistancePer");
        }
Example #2
0
        private static void makeOneNode(UIObjectData data, Transform tf)
        {
            //先prefab
            if (PrefabUtility.IsAnyPrefabInstanceRoot(tf.gameObject))
            {
                string prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(tf.gameObject);

                // Ctrl.print("element",prefabPath);

                if (_elementDic.contains(prefabPath))
                {
                    data.type  = UIElementType.Element;
                    data.style = _elementDic.get(prefabPath);

                    if (data.style == null)
                    {
                        data.style = "";
                    }
                }
                else
                {
                    makeContainer(data, tf);
                }
            }
            else
            {
                //控件
                if (tf.GetComponent <CanvasRenderer>() != null)
                {
                    if (tf.GetComponent <SContainer>() != null)
                    {
                        makeContainer(data, tf);
                    }
                    else if (tf.GetComponent <Button>() != null)
                    {
                        data.type = UIElementType.Button;
                    }
                    else if (tf.GetComponent <ImageFrameContainer>() != null)
                    {
                        data.type = UIElementType.ImageFrameContainer;
                    }
                    else if (tf.GetComponent <SScrollViewFake3D>() != null)
                    {
                        data.type = UIElementType.SScrollViewFake3D;
                        SScrollViewFake3D sScrollView = tf.GetComponent <SScrollViewFake3D>();
                        data.strArgs    = new string[1];
                        data.strArgs[0] = sScrollView.gridElement;
                    }
                    else if (tf.GetComponent <SScrollView>() != null)
                    {
                        data.type = UIElementType.SScrollView;
                        SScrollView sScrollView = tf.GetComponent <SScrollView>();
                        data.strArgs    = new string[1];
                        data.strArgs[0] = sScrollView.gridElement;
                    }
                    else if (tf.GetComponent <SPageView>() != null)
                    {
                        data.type = UIElementType.SPageView;
                        SPageView sPageView = tf.GetComponent <SPageView>();
                        data.strArgs    = new string[1];
                        data.strArgs[0] = sPageView.gridElement;
                    }
                    else if (tf.GetComponent <RawImageLoader>() != null)
                    {
                        data.type = UIElementType.RawImageLoader;
                    }
                    else if (tf.GetComponent <RawImage>() != null)
                    {
                        data.type = UIElementType.RawImage;
                    }
                    else if (tf.GetComponent <AdvancedText>() != null)
                    {
                        data.type = UIElementType.TextField;
                    }
                    else if (tf.GetComponent <InputField>() != null)
                    {
                        data.type = UIElementType.InputField;
                    }
                    else if (tf.GetComponent <BloodBar>() != null)
                    {
                        data.type = UIElementType.BloodBar;
                    }
                    else if (tf.GetComponent <Scrollbar>() != null)
                    {
                        data.type = UIElementType.ScrollBar;
                    }
                    else if (tf.GetComponent <Dropdown>() != null)
                    {
                        data.type = UIElementType.Dropdown;
                    }
                    else if (tf.GetComponent <Toggle>() != null)
                    {
                        data.type = UIElementType.Toggle;
                    }
                    else if (tf.GetComponent <Slider>() != null)
                    {
                        data.type = UIElementType.Slider;
                    }
                    else if (tf.GetComponent <ImageLoader>() != null)
                    {
                        data.type = UIElementType.ImageLoader;
                    }
                    else if (tf.GetComponent <Image>() != null)
                    {
                        data.type = UIElementType.Image;
                    }
                    else if (tf.GetComponent <I18NText>() != null)
                    {
                        data.type = UIElementType.I18NText;
                    }
                    else if (tf.GetComponent <Text>() != null)
                    {
                        data.type = UIElementType.Text;
                    }
                    else if (tf.GetComponent <SkeletonGraphicLoader>() != null)
                    {
                        data.type = UIElementType.SkeletonGraphicLoader;
                    }
                    else if (tf.GetComponent <SkeletonGraphic>() != null)
                    {
                        data.type = UIElementType.SkeletonGraphic;
                    }
                    else if (tf.GetComponent <GuideMask>() != null)
                    {
                        data.type = UIElementType.GuideMask;
                    }
                    else                     //其他脚本
                    {
                        makeContainer(data, tf);
                    }
                }
                else
                {
                    if (tf.GetComponent <Toggle>() != null)
                    {
                        data.type = UIElementType.Toggle;
                    }
                    else if (tf.GetComponent <Slider>() != null)
                    {
                        data.type = UIElementType.Slider;
                    }
                    else                     //什么都没有
                    {
                        makeContainer(data, tf);
                    }
                }
            }
        }