Esempio n. 1
0
        static int _m_IsRaycastLocationValid(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.UI.Mask gen_to_be_invoked = (UnityEngine.UI.Mask)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Vector2 _sp; translator.Get(L, 2, out _sp);
                    UnityEngine.Camera  _eventCamera = (UnityEngine.Camera)translator.GetObject(L, 3, typeof(UnityEngine.Camera));

                    bool gen_ret = gen_to_be_invoked.IsRaycastLocationValid(_sp, _eventCamera);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.UI.Mask mask = (UnityEngine.UI.Mask)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "showMaskGraphic":
                    mask.showMaskGraphic = reader.ReadProperty <System.Boolean> ();
                    break;

                case "useGUILayout":
                    mask.useGUILayout = reader.ReadProperty <System.Boolean> ();
                    break;

                case "enabled":
                    mask.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    mask.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    mask.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    mask.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Esempio n. 3
0
 public override void ReadFrom(object obj)
 {
     base.ReadFrom(obj);
     if (obj == null)
     {
         return;
     }
     UnityEngine.UI.Mask o = (UnityEngine.UI.Mask)obj;
     showMaskGraphic = o.showMaskGraphic;
 }
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.UI.Mask mask = (UnityEngine.UI.Mask)value;
     writer.WriteProperty("showMaskGraphic", mask.showMaskGraphic);
     writer.WriteProperty("useGUILayout", mask.useGUILayout);
     writer.WriteProperty("enabled", mask.enabled);
     writer.WriteProperty("tag", mask.tag);
     writer.WriteProperty("name", mask.name);
     writer.WriteProperty("hideFlags", mask.hideFlags);
 }
Esempio n. 5
0
        /// <summary>
        /// Cache some values for faster reference later
        /// </summary>
        void Awake()
        {
            _scrollRectTransform = scrollRect.GetComponent <RectTransform>();
            _scrollRectMask      = scrollRect.GetComponent <UnityEngine.UI.Mask>();
            // TODO: Remove
            //_scrollBarRectTransform = scrollbar.GetComponent<RectTransform>();
            //_originalScrollBarSize = _scrollBarRectTransform.sizeDelta;
            _lastScrollRectSize = _ScrollRectSize;

            SetScrollBarVisibility(scrollbarDisplayMode == ScrollbarDisplayMode.Always);
        }
Esempio n. 6
0
 public override object WriteTo(object obj, System.Collections.Generic.Dictionary <long, UnityEngine.Object> objects)
 {
     obj = base.WriteTo(obj, objects);
     if (obj == null)
     {
         return(null);
     }
     UnityEngine.UI.Mask o = (UnityEngine.UI.Mask)obj;
     o.showMaskGraphic = showMaskGraphic;
     return(o);
 }
Esempio n. 7
0
        static int _g_get_graphic(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.UI.Mask gen_to_be_invoked = (UnityEngine.UI.Mask)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.graphic);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Esempio n. 8
0
        static int _s_set_showMaskGraphic(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.UI.Mask gen_to_be_invoked = (UnityEngine.UI.Mask)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.showMaskGraphic = LuaAPI.lua_toboolean(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
        static int _g_get_showMaskGraphic(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.UI.Mask __cl_gen_to_be_invoked = (UnityEngine.UI.Mask)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, __cl_gen_to_be_invoked.showMaskGraphic);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
        static StackObject *get_rectTransform_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.UI.Mask instance_of_this_method = (UnityEngine.UI.Mask) typeof(UnityEngine.UI.Mask).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.rectTransform;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static StackObject *get_showMaskGraphic_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.UI.Mask instance_of_this_method = (UnityEngine.UI.Mask) typeof(UnityEngine.UI.Mask).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.showMaskGraphic;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
        static StackObject *set_showMaskGraphic_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @value = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.UI.Mask instance_of_this_method = (UnityEngine.UI.Mask) typeof(UnityEngine.UI.Mask).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.showMaskGraphic = value;

            return(__ret);
        }
        static StackObject *get_graphic_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.UI.Mask instance_of_this_method = (UnityEngine.UI.Mask) typeof(UnityEngine.UI.Mask).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.graphic;

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static int _m_MaskEnabled(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Mask __cl_gen_to_be_invoked = (UnityEngine.UI.Mask)translator.FastGetCSObj(L, 1);


            try {
                {
                    bool __cl_gen_ret = __cl_gen_to_be_invoked.MaskEnabled(  );
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_GetModifiedMaterial(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.Mask __cl_gen_to_be_invoked = (UnityEngine.UI.Mask)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Material baseMaterial = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));

                    UnityEngine.Material __cl_gen_ret = __cl_gen_to_be_invoked.GetModifiedMaterial(baseMaterial);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static StackObject *IsRaycastLocationValid_5(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Camera @eventCamera = (UnityEngine.Camera) typeof(UnityEngine.Camera).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Vector2 @sp = (UnityEngine.Vector2) typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.UI.Mask instance_of_this_method = (UnityEngine.UI.Mask) typeof(UnityEngine.UI.Mask).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.IsRaycastLocationValid(@sp, @eventCamera);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
            public void Create(PxPre.FileBrowse.FileBrowseProp prop, FileBrowser browser)
            {
                this.parentBrowser = browser;
                this.properties    = prop;

                const float scrollHorizHeight = 40.0f;
                const float scrollVertWidth   = 40.0f;

                GameObject goBrowseView = new GameObject("BrowseView");

                goBrowseView.transform.SetParent(this.gameObject.transform);
                goBrowseView.transform.localScale    = Vector3.one;
                goBrowseView.transform.localRotation = Quaternion.identity;
                RectTransform rtBrowseView = goBrowseView.AddComponent <RectTransform>();

                rtBrowseView.anchorMin = Vector2.zero;
                rtBrowseView.anchorMax = Vector2.one;
                rtBrowseView.pivot     = new Vector2(0.0f, 1.0f);
                rtBrowseView.offsetMin = new Vector2(5.0f, 5.0f);
                rtBrowseView.offsetMax = new Vector2(-5.0f, -5.0f);

                GameObject goViewport = new GameObject("Viewport");

                goViewport.transform.SetParent(goBrowseView.transform);
                goViewport.transform.localScale    = Vector3.one;
                goViewport.transform.localRotation = Quaternion.identity;
                RectTransform rtVP = goViewport.AddComponent <RectTransform>();

                rtVP.anchorMin = Vector2.zero;
                rtVP.anchorMax = Vector2.one;
                rtVP.pivot     = new Vector2(0.0f, 1.0f);
                rtVP.offsetMin = new Vector2(0.0f, scrollHorizHeight);
                rtVP.offsetMax = new Vector2(-scrollVertWidth, 0.0f);
                UnityEngine.UI.Image imgViewport = goViewport.AddComponent <UnityEngine.UI.Image>();
                UnityEngine.UI.Mask  maskVP      = goViewport.AddComponent <UnityEngine.UI.Mask>();


                GameObject goContent = new GameObject("Content");

                goContent.transform.SetParent(goViewport.transform);
                goContent.transform.localScale    = Vector3.one;
                goContent.transform.localRotation = Quaternion.identity;
                RectTransform rtContent = goContent.AddComponent <RectTransform>();

                rtContent.anchorMin = new Vector2(0.0f, 1.0f);
                rtContent.anchorMax = new Vector2(0.0f, 1.0f);
                rtContent.pivot     = new Vector2(0.0f, 1.0f);
                rtContent.offsetMin = new Vector2(0.0f, -10.0f);
                rtContent.offsetMax = new Vector2(10.0f, 0.0f);

                //      VERT SCROLL
                //
                ////////////////////////////////////////////////////////////////////////////////
                ///
                GameObject goVertScroll = new GameObject("VertScroll");

                goVertScroll.transform.SetParent(goBrowseView.transform);
                goVertScroll.transform.localScale    = Vector3.one;
                goVertScroll.transform.localRotation = Quaternion.identity;
                RectTransform rtVertScr = goVertScroll.AddComponent <RectTransform>();

                rtVertScr.anchorMin = new Vector2(1.0f, 0.0f);
                rtVertScr.anchorMax = new Vector2(1.0f, 1.0f);
                rtVertScr.pivot     = new Vector2(0.0f, 1.0f);
                rtVertScr.offsetMin = new Vector2(-scrollVertWidth, scrollHorizHeight);
                rtVertScr.offsetMax = new Vector2(0.0f, 0.0f);
                UnityEngine.UI.Image imgVertScr = goVertScroll.AddComponent <UnityEngine.UI.Image>();
                imgVertScr.sprite = this.properties.sliderSprite;
                imgVertScr.type   = UnityEngine.UI.Image.Type.Sliced;


                GameObject goVertThumb = new GameObject("VertThumb");

                goVertThumb.transform.SetParent(goVertScroll.transform);
                goVertThumb.transform.localScale    = Vector3.one;
                goVertThumb.transform.localRotation = Quaternion.identity;
                RectTransform rtVertThumb = goVertThumb.AddComponent <RectTransform>();

                rtVertThumb.pivot     = new Vector2(0.0f, 1.0f);
                rtVertThumb.offsetMin = Vector2.zero;
                rtVertThumb.offsetMax = Vector2.zero;
                UnityEngine.UI.Image imgVertThumb = goVertThumb.AddComponent <UnityEngine.UI.Image>();

                UnityEngine.UI.Scrollbar sbVert = goVertScroll.AddComponent <UnityEngine.UI.Scrollbar>();
                sbVert.handleRect    = rtVertThumb;
                sbVert.direction     = UnityEngine.UI.Scrollbar.Direction.BottomToTop;
                sbVert.targetGraphic = imgVertThumb;

                this.properties.sliderThumb.Apply(sbVert, imgVertThumb);

                //      HORIZ SCROLL
                //
                ////////////////////////////////////////////////////////////////////////////////
                ///
                GameObject goHorizScroll = new GameObject("HorizScroll");

                goHorizScroll.transform.SetParent(goBrowseView.transform);
                goHorizScroll.transform.localScale    = Vector3.one;
                goHorizScroll.transform.localRotation = Quaternion.identity;
                RectTransform rtHorizScr = goHorizScroll.AddComponent <RectTransform>();

                rtHorizScr.anchorMin = new Vector2(0.0f, 0.0f);
                rtHorizScr.anchorMax = new Vector2(1.0f, 0.0f);
                rtHorizScr.pivot     = new Vector2(0.0f, 1.0f);
                rtHorizScr.offsetMin = Vector2.zero;
                rtHorizScr.offsetMax = new Vector2(-scrollVertWidth, scrollHorizHeight);
                UnityEngine.UI.Image imgHorzScr = goHorizScroll.AddComponent <UnityEngine.UI.Image>();
                imgHorzScr.sprite = this.properties.sliderSprite;
                imgHorzScr.type   = UnityEngine.UI.Image.Type.Sliced;

                GameObject goHorizThumb = new GameObject("HorizThumb");

                goHorizThumb.transform.SetParent(rtHorizScr);
                goHorizThumb.transform.localScale    = Vector3.one;
                goHorizThumb.transform.localRotation = Quaternion.identity;
                RectTransform rtHorizThumb = goHorizThumb.AddComponent <RectTransform>();

                rtHorizThumb.pivot     = new Vector2(0.0f, 1.0f);
                rtHorizThumb.offsetMin = Vector2.zero;
                rtHorizThumb.offsetMax = Vector2.zero;
                UnityEngine.UI.Image imgHorizThumb = goHorizThumb.AddComponent <UnityEngine.UI.Image>();

                UnityEngine.UI.Scrollbar sbHoriz = goHorizScroll.AddComponent <UnityEngine.UI.Scrollbar>();
                sbHoriz.handleRect = rtHorizThumb;
                sbHoriz.direction  = UnityEngine.UI.Scrollbar.Direction.LeftToRight;

                this.properties.sliderThumb.Apply(sbHoriz, imgHorizThumb);

                //      RECT
                //
                ////////////////////////////////////////////////////////////////////////////////

                this.scrollRect                     = goBrowseView.AddComponent <UnityEngine.UI.ScrollRect>();
                this.scrollRect.viewport            = rtVP;
                this.scrollRect.content             = rtContent;
                this.scrollRect.horizontalScrollbar = sbHoriz;
                this.scrollRect.verticalScrollbar   = sbVert;
                this.scrollRect.scrollSensitivity   = this.properties.fileScrollSensitivity;

                //      FIN
                //
                ////////////////////////////////////////////////////////////////////////////////

                // Make dirty
                this.scrollRect.gameObject.SetActive(false);
                this.scrollRect.gameObject.SetActive(true);
            }
 /// <summary>
 /// Read the data using the reader.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public override object Read(ISaveGameReader reader)
 {
     UnityEngine.UI.Mask mask = SaveGameType.CreateComponent <UnityEngine.UI.Mask> ();
     ReadInto(mask, reader);
     return(mask);
 }
Esempio n. 19
0
        protected void _Create(
            EleBaseRect parent,
            ScrollInfo horiz,
            ScrollInfo vert,
            bool showBack,
            Vector2 size,
            float sensitivity,
            string name = "")
        {
            //      SCROLL ITEMS
            ////////////////////////////////////////////////////////////////////////////////
            GameObject go = new GameObject("ScrollRgn_" + name);

            go.transform.SetParent(parent.GetContentRect(), false);
            RectTransform rt = go.AddComponent <RectTransform>();

            rt.anchorMin = new Vector2(0.0f, 1.0f);
            rt.anchorMax = new Vector2(0.0f, 1.0f);
            rt.pivot     = new Vector2(0.0f, 1.0f);

            GameObject goViewport = new GameObject("Viewport_" + name);

            goViewport.transform.SetParent(go.transform, false);
            UnityEngine.UI.Image imgViewport = goViewport.AddComponent <UnityEngine.UI.Image>();
            RectTransform        rtViewport  = imgViewport.rectTransform;

            rtViewport.anchorMin = new Vector2(0.0f, 0.0f);
            rtViewport.anchorMax = new Vector2(1.0f, 1.0f);
            rtViewport.pivot     = new Vector2(0.0f, 1.0f);
            rtViewport.offsetMin = new Vector2(0.0f, 0.0f);
            rtViewport.offsetMax = new Vector2(0.0f, 0.0f);

            UnityEngine.UI.Mask maskViewport = goViewport.AddComponent <UnityEngine.UI.Mask>();
            maskViewport.showMaskGraphic = showBack;

            GameObject goContent = new GameObject("Content_" + name);

            goContent.transform.SetParent(goViewport.transform, false);
            RectTransform rtContent = goContent.AddComponent <RectTransform>();

            //
            //      VERTICAL SCROLLBAR
            ////////////////////////////////////////////////////////////////////////////////
            GameObject goScrollVert = new GameObject("ScrollVert_" + name);

            goScrollVert.transform.SetParent(go.transform, false);
            UnityEngine.UI.Image imgScrollVert = goScrollVert.AddComponent <UnityEngine.UI.Image>();
            RectTransform        rtScrollVert  = imgScrollVert.rectTransform;

            rtScrollVert.pivot            = new Vector2(0.0f, 1.0f);
            rtScrollVert.anchorMin        = new Vector2(1.0f, 0.0f);
            rtScrollVert.anchorMax        = new Vector2(1.0f, 1.0f);
            rtScrollVert.anchoredPosition = new Vector2(-vert.scrollbarDim, 0.0f);
            rtScrollVert.sizeDelta        = new Vector2(vert.scrollbarDim, 0.0f);
            imgScrollVert.sprite          = vert.backplateSprite;
            imgScrollVert.type            = UnityEngine.UI.Image.Type.Sliced;

            GameObject goThumbVert = new GameObject("ThumbVert_" + name);

            goThumbVert.transform.SetParent(goScrollVert.transform, false);
            UnityEngine.UI.Image imgThumbVert = goThumbVert.AddComponent <UnityEngine.UI.Image>();
            RectTransform        rtThumbVert  = imgThumbVert.rectTransform;

            rtThumbVert.pivot            = new Vector2(1.0f, 1.0f);
            rtThumbVert.anchorMin        = new Vector2(0.0f, 0.0f);
            rtThumbVert.anchorMax        = new Vector2(1.0f, 1.0f);
            rtThumbVert.anchoredPosition = new Vector2(0.0f, 0.0f);
            rtThumbVert.sizeDelta        = new Vector2(0.0f, 0.0f);

            ScrollTy sbVert = goScrollVert.AddComponent <ScrollTy>();

            sbVert.direction     = UnityEngine.UI.Scrollbar.Direction.BottomToTop;
            sbVert.targetGraphic = imgThumbVert;
            sbVert.handleRect    = rtThumbVert;
            vert.Apply(sbVert, imgThumbVert);

            //
            //      HORIZONTAL SCROLLBAR
            ////////////////////////////////////////////////////////////////////////////////
            GameObject goScrollHoriz = new GameObject("ScrollHoriz_" + name);

            goScrollHoriz.transform.SetParent(go.transform, false);
            UnityEngine.UI.Image imgScrollHoriz = goScrollHoriz.AddComponent <UnityEngine.UI.Image>();
            RectTransform        rtScrollHoriz  = imgScrollHoriz.rectTransform;

            rtScrollHoriz.pivot     = new Vector2(0.0f, 0.0f);
            rtScrollHoriz.anchorMin = new Vector2(0.0f, 0.0f);
            rtScrollHoriz.anchorMax = new Vector2(1.0f, 0.0f);
            rtScrollHoriz.sizeDelta = new Vector2(0.0f, horiz.scrollbarDim);
            imgScrollHoriz.sprite   = horiz.backplateSprite;
            imgScrollHoriz.type     = UnityEngine.UI.Image.Type.Sliced;

            GameObject goThumbHoriz = new GameObject("ThumbHoriz_" + name);

            goThumbHoriz.transform.SetParent(goScrollHoriz.transform, false);
            UnityEngine.UI.Image imgThumbHoriz = goThumbHoriz.AddComponent <UnityEngine.UI.Image>();
            RectTransform        rtThumbHoriz  = imgThumbHoriz.rectTransform;

            rtThumbHoriz.pivot            = new Vector2(0.0f, 1.0f);
            rtThumbHoriz.anchorMin        = new Vector2(0.0f, 0.0f);
            rtThumbHoriz.anchorMax        = new Vector2(1.0f, 1.0f);
            rtThumbHoriz.anchoredPosition = new Vector2(0.0f, 0.0f);
            rtThumbHoriz.sizeDelta        = new Vector2(0.0f, 0.0f);

            ScrollTy sbHoriz = goScrollHoriz.AddComponent <ScrollTy>();

            sbHoriz.direction     = UnityEngine.UI.Scrollbar.Direction.LeftToRight;
            sbHoriz.targetGraphic = imgThumbHoriz;
            sbHoriz.handleRect    = rtThumbHoriz;
            horiz.Apply(sbHoriz, imgThumbHoriz);

            //      FINISH
            ////////////////////////////////////////////////////////////////////////////////

            RectTy scrollR = go.AddComponent <RectTy>();

            scrollR.horizontalScrollbarVisibility = UnityEngine.UI.ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
            scrollR.verticalScrollbarVisibility   = UnityEngine.UI.ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
            scrollR.viewport            = rtViewport;
            scrollR.content             = rtContent;
            scrollR.horizontalScrollbar = sbHoriz;
            scrollR.verticalScrollbar   = sbVert;
            scrollR.scrollSensitivity   = sensitivity;

            this.viewportMask = maskViewport;
            //
            this.horizScroll = sbHoriz;
            this.vertScroll  = sbVert;
            //
            this.rt         = rt;
            this.scrollRect = scrollR;
        }