Пример #1
0
        static int _s_set_characterInfo(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Font gen_to_be_invoked = (UnityEngine.Font)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.characterInfo = (UnityEngine.CharacterInfo[])translator.GetObject(L, 2, typeof(UnityEngine.CharacterInfo[]));
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Пример #2
0
        static int _g_get_lineHeight(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Font gen_to_be_invoked = (UnityEngine.Font)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.lineHeight);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Пример #3
0
        static int _g_get_characterInfo(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Font gen_to_be_invoked = (UnityEngine.Font)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.characterInfo);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Пример #4
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.Font o = (UnityEngine.Font)obj;
     o.material      = (UnityEngine.Material)objects.Get(material);
     o.fontNames     = fontNames;
     o.characterInfo = characterInfo;
     return(o);
 }
Пример #5
0
        static int _m_RequestCharactersInTexture(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string characters = LuaAPI.lua_tostring(L, 2);

                    __cl_gen_to_be_invoked.RequestCharactersInTexture(characters);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    string characters = LuaAPI.lua_tostring(L, 2);
                    int    size       = LuaAPI.xlua_tointeger(L, 3);

                    __cl_gen_to_be_invoked.RequestCharactersInTexture(characters, size);



                    return(0);
                }
                if (__gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <UnityEngine.FontStyle>(L, 4))
                {
                    string characters = LuaAPI.lua_tostring(L, 2);
                    int    size       = LuaAPI.xlua_tointeger(L, 3);
                    UnityEngine.FontStyle style; translator.Get(L, 4, out style);

                    __cl_gen_to_be_invoked.RequestCharactersInTexture(characters, size, style);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Font.RequestCharactersInTexture!"));
        }
Пример #6
0
        static StackObject *get_characterInfo_7(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.Font instance_of_this_method = (UnityEngine.Font) typeof(UnityEngine.Font).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.characterInfo;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Пример #7
0
        static StackObject *Ctor_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);
            System.String name = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = new UnityEngine.Font(name);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Пример #8
0
        /** [シングルトン]constructor
         */
        private Render2D()
        {
            //ルート。
            {
                this.root_gameobject      = new UnityEngine.GameObject();
                this.root_gameobject.name = "Render2D";
                UnityEngine.GameObject.DontDestroyOnLoad(this.root_gameobject);
                this.root_transform = this.root_gameobject.GetComponent <UnityEngine.Transform>();
            }

            //イベントシステム作成。入力フィールド用。
            {
                if (Fee.Render2D.Config.CREATE_EVENTYSYSTEM == true)
                {
                    this.eventsystem = Fee.Instantiate.Instantiate.CreateEventSystem("EventSystem", null);
                    UnityEngine.GameObject.DontDestroyOnLoad(this.eventsystem);
                }
            }

            //スクリーン。
            this.screen = new Screen();

            //マテリアルリスト。
            this.materiallist = new Material_List();

            //スプライトリスト。
            this.spritelist = new SpriteList();

            //テキストリスト。
            this.textlist = new TextList();

            //入力フィールドリスト。
            this.inputfieldlist = new InputFieldList();

            //デフォルト。フォント。
            this.default_font = UnityEngine.Resources.GetBuiltinResource <UnityEngine.Font>(Config.DEFAULT_FONT_NAME);

            //レイヤーリスト。
            this.layerlist = new LayerList(this.root_gameobject.GetComponent <UnityEngine.Transform>());

            //バーテックス計算タスク。
            this.task_calcvertex = new Task_CalcVertex(this);

            //ソートリストタスク。
            this.task_sortlist = new Task_SortList(this);

            //callback_on_change_screen_size
            this.callback_on_change_screen_size = null;
        }
Пример #9
0
        static StackObject *get_lineHeight_9(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.Font instance_of_this_method = (UnityEngine.Font) typeof(UnityEngine.Font).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.lineHeight;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Пример #10
0
        private static void RebuildForFont(UnityEngine.Font f)
        {
            HashSet <Text> texts;

            m_Tracked.TryGetValue(f, out texts);

            if (texts == null)
            {
                return;
            }

            foreach (var text in texts)
            {
                text.FontTextureChanged();
            }
        }
Пример #11
0
        static StackObject *set_font_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, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Font value = (UnityEngine.Font) typeof(UnityEngine.Font).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.Text instance_of_this_method;
            instance_of_this_method = (UnityEngine.UI.Text) typeof(UnityEngine.UI.Text).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.font = value;

            return(__ret);
        }
Пример #12
0
        static StackObject *set_characterInfo_8(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.CharacterInfo[] @value = (UnityEngine.CharacterInfo[]) typeof(UnityEngine.CharacterInfo[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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

            instance_of_this_method.characterInfo = value;

            return(__ret);
        }
Пример #13
0
        static StackObject *RequestCharactersInTexture_20(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);
            System.String @characters = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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

            instance_of_this_method.RequestCharactersInTexture(@characters);

            return(__ret);
        }
Пример #14
0
        static StackObject *HasCharacter_13(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);
            System.Char @c = (char)ptr_of_this_method->Value;

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

            var result_of_this_method = instance_of_this_method.HasCharacter(@c);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Пример #15
0
        static StackObject *get_material_0(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.Font instance_of_this_method = (UnityEngine.Font) typeof(UnityEngine.Font).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.material;

            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));
        }
Пример #16
0
        /** [シングルトン]constructor
         */
        private Render2D()
        {
            //ルート。
            {
                this.root_gameobject      = new UnityEngine.GameObject();
                this.root_gameobject.name = "Render2D";
                UnityEngine.GameObject.DontDestroyOnLoad(this.root_gameobject);
                this.root_transform = this.root_gameobject.GetComponent <UnityEngine.Transform>();
            }

            //スクリーン。
            this.screen = new Screen();

            //マテリアルリスト。
            this.materiallist = new MaterialList();

            //スプライトリスト。
            this.spritelist = new SpriteList();

            //テキストリスト。
            this.textlist = new TextList();

            //入力フィールドリスト。
            this.inputfieldlist = new InputFieldList();

            //デフォルト。フォント。
            this.default_font = UnityEngine.Resources.GetBuiltinResource <UnityEngine.Font>(Config.DEFAULT_FONT_NAME);

            //レイヤーリスト。
            this.layerlist = new LayerList(this.root_gameobject.GetComponent <UnityEngine.Transform>());

            //Resourceリスト。
            this.resource_list = new ResourceList(this);

            //callback_on_change_screen_size
            this.callback_on_change_screen_size = null;

            //PlayerLoopType
            this.playerloop_flag = true;
            Fee.PlayerLoopSystem.PlayerLoopSystem.GetInstance().Add(PlayerLoopSystem.AddType.AddFirst, typeof(UnityEngine.PlayerLoop.PostLateUpdate), typeof(PlayerLoopType.PreDraw), this.PreDraw);
        }
Пример #17
0
        static int _m_GetFont(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Engine.IUIFont __cl_gen_to_be_invoked = (Engine.IUIFont)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Font __cl_gen_ret = __cl_gen_to_be_invoked.GetFont(  );
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Пример #18
0
        public void __Gen_Delegate_Imp25(UnityEngine.Font p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.Push(L, p0);

            PCall(L, 1, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Пример #19
0
        public static PFrame.Tiny.Font Convert(UnityEngine.Font ufont)
        {
            var font = new PFrame.Tiny.Font();

            font.Ascent     = ufont.ascent;
            font.LineHeight = ufont.lineHeight;
            font.FontSize   = ufont.fontSize;

            var ucharInfos       = ufont.characterInfo;
            var num              = ucharInfos.Length;
            var characterInfoMap = new NativeHashMap <int, PFrame.Tiny.CharacterInfo>(num, Allocator.Temp);

            for (int i = 0; i < num; i++)
            {
                var ucharInfo = ucharInfos[i];
                var charInfo  = TinyAuthoringUtil.Convert(ucharInfo);
                characterInfoMap.Add(charInfo.index, charInfo);
            }
            font.CharacterInfoMap = characterInfoMap;

            return(font);
        }
Пример #20
0
        static int _m_CreateDynamicFontFromOSFont_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    string fontname = LuaAPI.lua_tostring(L, 1);
                    int    size     = LuaAPI.xlua_tointeger(L, 2);

                    UnityEngine.Font __cl_gen_ret = UnityEngine.Font.CreateDynamicFontFromOSFont(fontname, size);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 2 && translator.Assignable <string[]>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    string[] fontnames = (string[])translator.GetObject(L, 1, typeof(string[]));
                    int      size      = LuaAPI.xlua_tointeger(L, 2);

                    UnityEngine.Font __cl_gen_ret = UnityEngine.Font.CreateDynamicFontFromOSFont(fontnames, size);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Font.CreateDynamicFontFromOSFont!"));
        }
Пример #21
0
        static int _m_HasCharacter(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


            try {
                {
                    char c = (char)LuaAPI.xlua_tointeger(L, 2);

                    bool __cl_gen_ret = __cl_gen_to_be_invoked.HasCharacter(c);
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Пример #22
0
        static StackObject *GetCharacterInfo_17(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, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.CharacterInfo @info = (UnityEngine.CharacterInfo) typeof(UnityEngine.CharacterInfo).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Char @ch = (char)ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Font instance_of_this_method = (UnityEngine.Font) typeof(UnityEngine.Font).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.GetCharacterInfo(@ch, out @info);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.StackObjectReference:
            {
                var    ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                object ___obj = @info;
                if (___dst->ObjectType >= ObjectTypes.Object)
                {
                    if (___obj is CrossBindingAdaptorType)
                    {
                        ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
                    }
                    __mStack[___dst->Value] = ___obj;
                }
                else
                {
                    ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
                }
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @info;
                }
                else
                {
                    var ___type = __domain.GetType(___obj.GetType()) as CLRType;
                    ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @info);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var ___type = __domain.GetType(ptr_of_this_method->Value);
                if (___type is ILType)
                {
                    ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @info;
                }
                else
                {
                    ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @info);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.CharacterInfo[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = @info;
            }
            break;
            }

            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            __intp.Free(ptr_of_this_method);
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }