Exemplo n.º 1
0
 public override void ReadFrom(object obj)
 {
     base.ReadFrom(obj);
     if (obj == null)
     {
         return;
     }
     UnityEngine.UI.LayoutGroup o = (UnityEngine.UI.LayoutGroup)obj;
     padding        = o.padding;
     childAlignment = (uint)o.childAlignment;
 }
Exemplo n.º 2
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.LayoutGroup o = (UnityEngine.UI.LayoutGroup)obj;
     o.padding        = padding;
     o.childAlignment = (UnityEngine.TextAnchor)childAlignment;
     return(o);
 }
        static int _s_set_padding(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.UI.LayoutGroup __cl_gen_to_be_invoked = (UnityEngine.UI.LayoutGroup)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.padding = (UnityEngine.RectOffset)translator.GetObject(L, 2, typeof(UnityEngine.RectOffset));
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int _g_get_layoutPriority(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.UI.LayoutGroup __cl_gen_to_be_invoked = (UnityEngine.UI.LayoutGroup)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, __cl_gen_to_be_invoked.layoutPriority);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
        static int _g_get_childAlignment(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.UI.LayoutGroup __cl_gen_to_be_invoked = (UnityEngine.UI.LayoutGroup)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineTextAnchor(L, __cl_gen_to_be_invoked.childAlignment);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
Exemplo n.º 6
0
        public static void UpdateLayout(UnityEngine.UI.LayoutGroup layout)
        {
            if (layout == null)
            {
                return;
            }

            layout.CalculateLayoutInputHorizontal();
            layout.SetLayoutHorizontal();
            layout.CalculateLayoutInputVertical();
            layout.SetLayoutVertical();
        }
        static int _g_get_flexibleHeight(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.UI.LayoutGroup gen_to_be_invoked = (UnityEngine.UI.LayoutGroup)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, gen_to_be_invoked.flexibleHeight);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
        static int _s_set_childAlignment(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.UI.LayoutGroup gen_to_be_invoked = (UnityEngine.UI.LayoutGroup)translator.FastGetCSObj(L, 1);
                UnityEngine.TextAnchor     gen_value; translator.Get(L, 2, out gen_value);
                gen_to_be_invoked.childAlignment = gen_value;
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
        static StackObject *get_childAlignment_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, 1);

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

            var result_of_this_method = instance_of_this_method.childAlignment;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        static StackObject *SetLayoutVertical_14(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.LayoutGroup instance_of_this_method = (UnityEngine.UI.LayoutGroup) typeof(UnityEngine.UI.LayoutGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetLayoutVertical();

            return(__ret);
        }
        static StackObject *get_flexibleHeight_11(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.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.LayoutGroup instance_of_this_method = (UnityEngine.UI.LayoutGroup) typeof(UnityEngine.UI.LayoutGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.flexibleHeight;

            __ret->ObjectType       = ObjectTypes.Float;
            *(float *)&__ret->Value = result_of_this_method;
            return(__ret + 1);
        }
        static StackObject *get_layoutPriority_12(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.LayoutGroup instance_of_this_method = (UnityEngine.UI.LayoutGroup) typeof(UnityEngine.UI.LayoutGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.layoutPriority;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
        static StackObject *set_childAlignment_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, 2);

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

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

            instance_of_this_method.childAlignment = value;

            return(__ret);
        }
        static StackObject *set_padding_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.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);
            UnityEngine.RectOffset @value = (UnityEngine.RectOffset) typeof(UnityEngine.RectOffset).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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

            instance_of_this_method.padding = value;

            return(__ret);
        }
        static int _m_CalculateLayoutInputVertical(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


            try {
                {
                    __cl_gen_to_be_invoked.CalculateLayoutInputVertical(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static StackObject *get_padding_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.LayoutGroup instance_of_this_method = (UnityEngine.UI.LayoutGroup) typeof(UnityEngine.UI.LayoutGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.padding;

            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_SetLayoutHorizontal(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    gen_to_be_invoked.SetLayoutHorizontal(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemplo n.º 18
0
        public UINode DrawLayer(Layer layer, UINode parent)
        {
            UINode node = PSDImportUtility.InstantiateItem(PSDImporterConst.PREFAB_PATH_GROUP, layer.name, parent);

            UnityEngine.UI.LayoutGroup group = null;
            string type = layer.arguments[0].ToLower();
            float  span = 0;

            float.TryParse(layer.arguments[1], out span);
            switch (type)
            {
            case "v":
                group = node.AddComponent <UnityEngine.UI.VerticalLayoutGroup>();
                group.childAlignment = TextAnchor.UpperLeft;
                ((UnityEngine.UI.VerticalLayoutGroup)group).spacing = span;
                break;

            case "h":
                group = node.AddComponent <UnityEngine.UI.HorizontalLayoutGroup>();
                group.childAlignment = TextAnchor.UpperLeft;
                ((UnityEngine.UI.HorizontalLayoutGroup)group).spacing = span;
                break;
            }

            PSDImportUtility.SetRectTransform(layer, group.GetComponent <RectTransform>(), parent.GetComponent <RectTransform>());

            UINode[] nodes = pSDImportCtrl.DrawImages(layer.images, node);
            foreach (var item in nodes)
            {
                item.anchoType = UINode.AnchoType.Left | UINode.AnchoType.Up;
            }
            nodes = pSDImportCtrl.DrawLayers(layer.layers, node);
            foreach (var item in nodes)
            {
                item.anchoType = UINode.AnchoType.Left | UINode.AnchoType.Up;
            }
            return(node);
        }
Exemplo n.º 19
0
        public UGUINode DrawLayer(GroupNode layer, UGUINode parent)
        {
            UGUINode node = PSDImportUtility.InstantiateItem(GroupType.GROUP, layer.Name, parent);

            UnityEngine.UI.LayoutGroup group = null;
            switch (layer.direction)
            {
            case Direction.Horizontal:
                group = node.InitComponent <UnityEngine.UI.HorizontalLayoutGroup>();
                group.childAlignment = TextAnchor.UpperLeft;
                break;

            case Direction.Vertical:
                group = node.InitComponent <UnityEngine.UI.VerticalLayoutGroup>();
                group.childAlignment = TextAnchor.UpperLeft;
                break;

            default:
                break;
            }
            ((UnityEngine.UI.VerticalLayoutGroup)group).spacing = layer.spacing;

            PSDImportUtility.SetRectTransform(layer, group.GetComponent <RectTransform>());

            UGUINode[] nodes = pSDImportCtrl.DrawImages(layer.images.ToArray(), node);
            foreach (var item in nodes)
            {
                item.anchoType = AnchoType.Left | AnchoType.Up;
            }
            nodes = pSDImportCtrl.DrawLayers(layer.groups.ToArray(), node);
            foreach (var item in nodes)
            {
                item.anchoType = AnchoType.Left | AnchoType.Up;
            }
            return(node);
        }
Exemplo n.º 20
0
 protected override void OnInit()
 {
     _uiTile         = GetComponent <UnityEngine.UI.LayoutGroup>();
     cachedTransform = _uiTile.transform;
     base.OnInit();
 }