예제 #1
0
        static StackObject *set_image_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.Texture value = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.GUIContent instance_of_this_method;
            instance_of_this_method = (UnityEngine.GUIContent) typeof(UnityEngine.GUIContent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.image = value;

            return(__ret);
        }
예제 #2
0
        static StackObject *set_wrapModeW_21(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.TextureWrapMode @value = (UnityEngine.TextureWrapMode) typeof(UnityEngine.TextureWrapMode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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

            instance_of_this_method.wrapModeW = value;

            return(__ret);
        }
        static StackObject *set_mainTexture_2(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.Texture @value = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Material instance_of_this_method = (UnityEngine.Material) typeof(UnityEngine.Material).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.mainTexture = value;

            return(__ret);
        }
예제 #4
0
        static StackObject *SetAlphaTexture_20(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.Texture texture = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.CanvasRenderer instance_of_this_method;
            instance_of_this_method = (UnityEngine.CanvasRenderer) typeof(UnityEngine.CanvasRenderer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetAlphaTexture(texture);

            return(__ret);
        }
        static StackObject *Invoke_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, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Texture @obj = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Action <UnityEngine.Texture> instance_of_this_method = (System.Action <UnityEngine.Texture>) typeof(System.Action <UnityEngine.Texture>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 8);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Invoke(@obj);

            return(__ret);
        }
예제 #6
0
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    UnityEngine.Texture __cl_gen_ret = new UnityEngine.Texture();
                    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.Texture constructor!"));
        }
예제 #7
0
        static StackObject *Ctor_2(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.Rect @region = (UnityEngine.Rect) typeof(UnityEngine.Rect).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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


            var result_of_this_method = new FairyGUI.NTexture(@texture, @region);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
예제 #8
0
        static StackObject *DrawGUITexture_33(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.Texture @texture = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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


            UnityEngine.Gizmos.DrawGUITexture(@screenRect, @texture);

            return(__ret);
        }
        static StackObject *Ctor_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.Texture tex = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = new UnityEngine.Rendering.RenderTargetIdentifier(tex);

            if (!isNewObj)
            {
                __ret--;
                WriteBackInstance(__domain, __ret, __mStack, ref result_of_this_method);
                return(__ret);
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
예제 #10
0
        static StackObject *Ctor_6(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);
            System.String tooltip = (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.Texture image = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.String text = (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.GUIContent(text, image, tooltip);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        public UnityEngine.Material GetMaterial(RenderPrimitive renderPrimitive)
        {
            UnityEngine.Texture texture = (GradientTexture as Unity_Texture).Native;

            UnityEngine.Material material;
            if (renderPrimitive.IsAATextured)
            {
                material = Material_AA;

                material.mainTexture = texture;
            }
            else
            {
                material = Material_Solid;

                material.mainTexture = texture;
            }

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


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


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <UnityEngine.Texture>(L, 4))
                {
                    int kernelIndex             = LuaAPI.xlua_tointeger(L, 2);
                    int nameID                  = LuaAPI.xlua_tointeger(L, 3);
                    UnityEngine.Texture texture = (UnityEngine.Texture)translator.GetObject(L, 4, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetTexture(kernelIndex, nameID, texture);



                    return(0);
                }
                if (__gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Texture>(L, 4))
                {
                    int    kernelIndex          = LuaAPI.xlua_tointeger(L, 2);
                    string name                 = LuaAPI.lua_tostring(L, 3);
                    UnityEngine.Texture texture = (UnityEngine.Texture)translator.GetObject(L, 4, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetTexture(kernelIndex, name, texture);



                    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.ComputeShader.SetTexture!"));
        }
예제 #13
0
        static int _m_GetTextureByType_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    AlertAreaType _type; translator.Get(L, 1, out _type);

                    UnityEngine.Texture __cl_gen_ret = GameStageUtility.GetTextureByType(_type);
                    translator.Push(L, __cl_gen_ret);



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



                {
                    UnityEngine.Texture _texture = (UnityEngine.Texture)translator.GetObject(L, 1, typeof(UnityEngine.Texture));

                    UnityEngine.Sprite gen_ret = BabyEngine.Utility.TextureToSprite(_texture);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #15
0
        public void __Gen_Delegate_Imp4(UnityEngine.Texture 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
        }
예제 #16
0
        static int _m_GetNativeTexturePtr(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


            try {
                {
                    System.IntPtr __cl_gen_ret = __cl_gen_to_be_invoked.GetNativeTexturePtr(  );
                    LuaAPI.lua_pushlightuserdata(L, __cl_gen_ret);



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


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


            try {
                {
                    UnityEngine.Texture __cl_gen_ret = __cl_gen_to_be_invoked.GetTexture(  );
                    translator.Push(L, __cl_gen_ret);



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


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



                {
                    gen_to_be_invoked.IncrementUpdateCount(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #19
0
        private static IntPtr EnsureNativePointer(UnityEngine.Texture tex)
        {
            IntPtr nativeTexturePtr = tex.GetNativeTexturePtr();

            if (nativeTexturePtr == IntPtr.Zero)
            {
                UnityEngine.RenderTexture renderTexture = tex as UnityEngine.RenderTexture;
                if (renderTexture != null)
                {
                    renderTexture.Create();
                }

                nativeTexturePtr = tex.GetNativeTexturePtr();
                if (nativeTexturePtr == IntPtr.Zero)
                {
                    throw new System.Exception("Can't create TextureSource, texture native pointer is null");
                }
            }

            return(nativeTexturePtr);
        }
예제 #20
0
        static StackObject *Reload_16(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.Texture @alphaTexture = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

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

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

            instance_of_this_method.Reload(@nativeTexture, @alphaTexture);

            return(__ret);
        }
예제 #21
0
        static StackObject *SetTexture_3(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.Texture @texture = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String @name = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            ET.DynamicAtlas instance_of_this_method = (ET.DynamicAtlas) typeof(ET.DynamicAtlas).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetTexture(@name, @texture);

            return(__ret);
        }
예제 #22
0
        static int _m_SetTexture(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


                int __gen_param_count = LuaAPI.lua_gettop(L);

                if (__gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.Texture>(L, 3))
                {
                    int nameID = LuaAPI.xlua_tointeger(L, 2);
                    UnityEngine.Texture value = (UnityEngine.Texture)translator.GetObject(L, 3, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetTexture(nameID, value);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Texture>(L, 3))
                {
                    string name = LuaAPI.lua_tostring(L, 2);
                    UnityEngine.Texture value = (UnityEngine.Texture)translator.GetObject(L, 3, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetTexture(name, value);



                    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.MaterialPropertyBlock.SetTexture!"));
        }
예제 #23
0
        static int _m_GetTexture(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int nameID = LuaAPI.xlua_tointeger(L, 2);

                    UnityEngine.Texture __cl_gen_ret = __cl_gen_to_be_invoked.GetTexture(nameID);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string name = LuaAPI.lua_tostring(L, 2);

                    UnityEngine.Texture __cl_gen_ret = __cl_gen_to_be_invoked.GetTexture(name);
                    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.MaterialPropertyBlock.GetTexture!"));
        }
예제 #24
0
        static StackObject *SetTexture_16(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, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Texture texture = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 nameID = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Int32 kernelIndex = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            UnityEngine.ComputeShader instance_of_this_method;
            instance_of_this_method = (UnityEngine.ComputeShader) typeof(UnityEngine.ComputeShader).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetTexture(kernelIndex, nameID, texture);

            return(__ret);
        }
예제 #25
0
        static int _m_SetAlphaTexture(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


            try {
                {
                    UnityEngine.Texture texture = (UnityEngine.Texture)translator.GetObject(L, 2, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetAlphaTexture(texture);



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


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


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 3 && translator.Assignable <UnityEngine.Material>(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    UnityEngine.Material material = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
                    int index = LuaAPI.xlua_tointeger(L, 3);

                    __cl_gen_to_be_invoked.SetMaterial(material, index);



                    return(0);
                }
                if (__gen_param_count == 3 && translator.Assignable <UnityEngine.Material>(L, 2) && translator.Assignable <UnityEngine.Texture>(L, 3))
                {
                    UnityEngine.Material material = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
                    UnityEngine.Texture  texture  = (UnityEngine.Texture)translator.GetObject(L, 3, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetMaterial(material, texture);



                    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.CanvasRenderer.SetMaterial!"));
        }
        static StackObject *SetResult_5(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.Texture @ret = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            ET.ETAsyncTaskMethodBuilder <UnityEngine.Texture> instance_of_this_method = (ET.ETAsyncTaskMethodBuilder <UnityEngine.Texture>) typeof(ET.ETAsyncTaskMethodBuilder <UnityEngine.Texture>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 16);

            instance_of_this_method.SetResult(@ret);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(__ret);
        }
예제 #28
0
        static StackObject *Blit_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, 3);

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

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

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Texture @source = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            UnityEngine.Graphics.Blit(@source, @dest, @mat);

            return(__ret);
        }
예제 #29
0
        static int _m_SetGlobalTexture_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable <UnityEngine.Texture>(L, 2))
                {
                    int nameID = LuaAPI.xlua_tointeger(L, 1);
                    UnityEngine.Texture tex = (UnityEngine.Texture)translator.GetObject(L, 2, typeof(UnityEngine.Texture));

                    UnityEngine.Shader.SetGlobalTexture(nameID, tex);



                    return(0);
                }
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Texture>(L, 2))
                {
                    string propertyName     = LuaAPI.lua_tostring(L, 1);
                    UnityEngine.Texture tex = (UnityEngine.Texture)translator.GetObject(L, 2, typeof(UnityEngine.Texture));

                    UnityEngine.Shader.SetGlobalTexture(propertyName, tex);



                    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.Shader.SetGlobalTexture!"));
        }
예제 #30
0
        static int _m_SetHandBookPicture(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            xc.ui.UIHandBookItemSlot __cl_gen_to_be_invoked = (xc.ui.UIHandBookItemSlot)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 picturePath = LuaAPI.lua_tostring(L, 2);

                    __cl_gen_to_be_invoked.SetHandBookPicture(picturePath);



                    return(0);
                }
                if (__gen_param_count == 2 && translator.Assignable <UnityEngine.Texture>(L, 2))
                {
                    UnityEngine.Texture picture = (UnityEngine.Texture)translator.GetObject(L, 2, typeof(UnityEngine.Texture));

                    __cl_gen_to_be_invoked.SetHandBookPicture(picture);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to xc.ui.UIHandBookItemSlot.SetHandBookPicture!"));
        }
예제 #31
0
            private void Update()
            {
                if (MapView.MapIsEnabled && map_renderer_ == null) {
                  map_renderer_ = MapView.MapCamera.gameObject.AddComponent<MapRenderer>();
                  map_renderer_.render_on_pre_cull = RenderTrajectories;
                }
                override_rsas_target_ = false;
                Vessel active_vessel = FlightGlobals.ActiveVessel;
                if (active_vessel != null &&
                !FlightGlobals.ActiveVessel.isEVA) {
                  if (navball_ == null) {
                navball_ = (NavBall)FindObjectOfType(typeof(NavBall));
                  }
                  if (compass_navball_texture_ == null) {
                compass_navball_texture_ =
                navball_.navBall.renderer.material.mainTexture;
                  }

                  if (navball_changed_) {
                // Texture the ball.
                navball_changed_ = false;
                // TODO(egg): switch over all frame types and have more navball textures
                // when more frames are available.
                if (!fix_navball_in_plotting_frame_ || !PluginRunning()) {
                  navball_.navBall.renderer.material.mainTexture =
                  compass_navball_texture_;
                } else if (plotting_frame_selector_.get().frame_type ==
                   ReferenceFrameSelector.FrameType.BODY_CENTRED_NON_ROTATING) {
                  navball_.navBall.renderer.material.mainTexture =
                  inertial_navball_texture_;
                } else {
                  navball_.navBall.renderer.material.mainTexture =
                  barycentric_navball_texture_;
                }
                  }

                  if (PluginRunning() && fix_navball_in_plotting_frame_) {
                // Orient the ball.
                navball_.navBall.rotation =
                (UnityEngine.QuaternionD)navball_.attitudeGymbal *  // sic.
                (UnityEngine.QuaternionD)plugin_.NavballOrientation(
                    (XYZ)Planetarium.fetch.Sun.position,
                    (XYZ)(Vector3d)active_vessel.ReferenceTransform.position);
                // TODO(egg): the navball should be independent from the frame of the
                // Frenet trihedron (seeing your body-centric velocity with a compass
                // navball like in stock makes sense, so does seeing your velocity in
                // any reference frame with the fixed stars navball), although the
                // Frenet trihedron should be in the same frame as the map view
                // trajectory.  Right now when in space the navball is always linked to
                // the frame of the Frenet trihedron and the trajectory.
                if (has_active_vessel_in_space() &&
                  plugin_.HasVessel(active_vessel.id.ToString())) {
                  // Orient the Frenet trihedron.
                  Vector3d prograde =
                  (Vector3d)plugin_.VesselTangent(active_vessel.id.ToString());
                  Vector3d radial =
                  (Vector3d)plugin_.VesselNormal(active_vessel.id.ToString());
                  // Yes, the astrodynamicist's normal is the mathematician's binormal.
                  // Don't ask.
                  Vector3d normal =
                  (Vector3d)plugin_.VesselBinormal(active_vessel.id.ToString());

                  navball_.progradeVector.transform.localPosition =
                  (UnityEngine.QuaternionD)navball_.attitudeGymbal *
                  prograde * 0.05;
                  navball_.radialInVector.transform.localPosition =
                  (UnityEngine.QuaternionD)navball_.attitudeGymbal *
                  radial * 0.05;
                  navball_.normalVector.transform.localPosition =
                  (UnityEngine.QuaternionD)navball_.attitudeGymbal *
                  normal * 0.05;
                  navball_.retrogradeVector.transform.localPosition =
                  -navball_.progradeVector.transform.localPosition;
                  navball_.radialOutVector.transform.localPosition =
                  -navball_.radialInVector.transform.localPosition;
                  navball_.antiNormalVector.transform.localPosition =
                  -navball_.normalVector.transform.localPosition;
                  // Make the autopilot target our Frenet trihedron.
                  if (active_vessel.OnAutopilotUpdate.GetInvocationList()[0] !=
                  (Delegate)(FlightInputCallback)OverrideRSASTarget) {
                Log.Info("Prepending RSAS override");
                active_vessel.OnAutopilotUpdate =
                (FlightInputCallback)Delegate.Combine(
                    new FlightInputCallback(OverrideRSASTarget),
                    active_vessel.OnAutopilotUpdate);
                  }
                  if (active_vessel.Autopilot.Enabled) {
                override_rsas_target_ = true;
                switch (active_vessel.Autopilot.Mode) {
                  case VesselAutopilot.AutopilotMode.Prograde:
                rsas_target_ = prograde;
                break;
                  case VesselAutopilot.AutopilotMode.Retrograde:
                rsas_target_ = -prograde;
                break;
                  case VesselAutopilot.AutopilotMode.RadialIn:
                rsas_target_ = radial;
                break;
                  case VesselAutopilot.AutopilotMode.RadialOut:
                rsas_target_ = -radial;
                break;
                  case VesselAutopilot.AutopilotMode.Normal:
                rsas_target_ = normal;
                break;
                  case VesselAutopilot.AutopilotMode.Antinormal:
                rsas_target_ = -normal;
                break;
                  default:
                override_rsas_target_ = false;
                break;
                }
                  }
                }
                  }
                }
            }
예제 #32
0
            private void Update()
            {
                if (MapView.MapIsEnabled && map_renderer_ == null) {
                  map_renderer_ = MapView.MapCamera.gameObject.AddComponent<MapRenderer>();
                  map_renderer_.render_on_pre_cull = RenderTrajectories;
                }
                override_rsas_target_ = false;
                Vessel active_vessel = FlightGlobals.ActiveVessel;
                if (active_vessel != null &&
                !FlightGlobals.ActiveVessel.isEVA) {
                  if (navball_ == null) {
                navball_ = (NavBall)FindObjectOfType(typeof(NavBall));
                  }
                  if (compass_navball_texture_ == null) {
                compass_navball_texture_ =
                navball_.navBall.renderer.material.mainTexture;
                  }

                  if (navball_changed_) {
                // Texture the ball.
                navball_changed_ = false;
                if (!fix_navball_in_plotting_frame_ || !PluginRunning()) {
                  navball_.navBall.renderer.material.mainTexture =
                  compass_navball_texture_;
                } else if (first_selected_celestial_ == second_selected_celestial_) {
                  navball_.navBall.renderer.material.mainTexture =
                  inertial_navball_texture_;
                } else {
                  navball_.navBall.renderer.material.mainTexture =
                  barycentric_navball_texture_;
                }
                  }

                  if (PluginRunning() && fix_navball_in_plotting_frame_) {
                // Orient the ball.
                navball_.navBall.rotation =
                (UnityEngine.QuaternionD)navball_.attitudeGymbal *  // sic.
                (UnityEngine.QuaternionD)NavballOrientation(
                    plugin_,
                    transforms_,
                    (XYZ)Planetarium.fetch.Sun.position,
                    (XYZ)(Vector3d)active_vessel.ReferenceTransform.position);
                // TODO(egg): the navball should be independent from the frame of the
                // Frenet trihedron (seeing your body-centric velocity with a compass
                // navball like in stock makes sense, so does seeing your velocity in
                // any reference frame with the fixed stars navball), although the
                // Frenet trihedron should be in the same frame as the map view
                // trajectory.  Right now when in space the navball is always linked to
                // the frame of the Frenet trihedron and the trajectory.
                if (has_active_vessel_in_space() &&
                has_vessel(plugin_, active_vessel.id.ToString())) {
                  // Orient the Frenet trihedron.
                  // TODO(egg): just the tangent for now.
                  Vector3d prograde =
                  (Vector3d)VesselTangent(plugin_,
                                      active_vessel.id.ToString(),
                                      transforms_);
                  navball_.progradeVector.transform.localPosition =
                  (UnityEngine.QuaternionD)navball_.attitudeGymbal *
                  prograde * 0.05;
                  navball_.retrogradeVector.transform.localPosition =
                  -navball_.progradeVector.transform.localPosition;
                  // Make the autopilot target our Frenet trihedron.
                  // TODO(egg): just the tangent for now.
                  if (active_vessel.OnAutopilotUpdate.GetInvocationList()[0] !=
                  (Delegate)(FlightInputCallback)OverrideRSASTarget) {
                Log.Info("Prepending RSAS override");
                active_vessel.OnAutopilotUpdate =
                (FlightInputCallback)Delegate.Combine(
                    new FlightInputCallback(OverrideRSASTarget),
                    active_vessel.OnAutopilotUpdate);
                  }
                  if (active_vessel.Autopilot.Enabled) {
                override_rsas_target_ = true;
                switch (active_vessel.Autopilot.Mode) {
                  case VesselAutopilot.AutopilotMode.Prograde:
                rsas_target_ = prograde;
                break;
                  case VesselAutopilot.AutopilotMode.Retrograde:
                rsas_target_ = -prograde;
                break;
                  default:
                override_rsas_target_ = false;
                break;
                }
                  }
                }
                  }
                }
            }
예제 #33
0
            private void LateUpdate()
            {
                if (map_renderer_ == null) {
                  map_renderer_ =
                  PlanetariumCamera.Camera.gameObject.AddComponent<RenderingActions>();
                  map_renderer_.post_render = RenderTrajectories;
                }

                if (galaxy_cube_rotator_ == null) {
                  galaxy_cube_rotator_ = ScaledCamera.Instance.galaxyCamera.gameObject
                                 .AddComponent<RenderingActions>();
                  galaxy_cube_rotator_.pre_cull = RotateGalaxyCube;
                }

                // Orient the celestial bodies.
                if (PluginRunning()) {
                  foreach (var body in FlightGlobals.Bodies) {
                body.scaledBody.transform.rotation =
                (UnityEngine.QuaternionD)plugin_.CelestialRotation(
                body.flightGlobalsIndex);
                  }
                }

                override_rsas_target_ = false;
                Vessel active_vessel = FlightGlobals.ActiveVessel;
                if (active_vessel != null &&
                !FlightGlobals.ActiveVessel.isEVA) {
                  if (navball_ == null) {
                navball_ = (KSP.UI.Screens.Flight.NavBall)FindObjectOfType(
                       typeof(KSP.UI.Screens.Flight.NavBall));
                  }
                  var navball_material =
                  navball_.navBall.GetComponent<UnityEngine.Renderer>().material;

                  if (compass_navball_texture_ == null) {
                compass_navball_texture_ = navball_material.GetTexture("_MainTexture");
                  }

                  Action<UnityEngine.Texture> set_navball_texture = (texture) =>
                  navball_material.SetTexture("_MainTexture", texture);

                  if (navball_changed_) {
                // Texture the ball.
                navball_changed_ = false;
                // TODO(egg): switch over all frame types and have more navball textures
                // when more frames are available.
                if (!fix_navball_in_plotting_frame_ || !PluginRunning()) {
                  set_navball_texture(compass_navball_texture_);
                } else if (plotting_frame_selector_.get().frame_type ==
                   ReferenceFrameSelector.FrameType.BODY_CENTRED_NON_ROTATING) {
                  set_navball_texture(inertial_navball_texture_);
                } else {
                  set_navball_texture(barycentric_navball_texture_);
                }
                  }

                  // Orient the ball.
                  if (PluginRunning() && fix_navball_in_plotting_frame_) {
                navball_.navBall.rotation =
                (UnityEngine.QuaternionD)navball_.attitudeGymbal *  // sic.
                (UnityEngine.QuaternionD)plugin_.NavballOrientation(
                (XYZ)Planetarium.fetch.Sun.position,
                (XYZ)(Vector3d)active_vessel.ReferenceTransform.position);
                  }

                  if (PluginRunning() &&
                  has_active_vessel_in_space() &&
                  plugin_.HasVessel(active_vessel.id.ToString()) &&
                  FlightGlobals.speedDisplayMode ==
                  FlightGlobals.SpeedDisplayModes.Orbit) {
                KSP.UI.Screens.Flight.SpeedDisplay speed_display =
                KSP.UI.Screens.Flight.SpeedDisplay.Instance;
                if (speed_display?.textTitle != null &&
                speed_display?.textSpeed != null) {
                  speed_display.textTitle.text =
                  plotting_frame_selector_.get().ShortName();
                  speed_display.textSpeed.text =
                  ((Vector3d)plugin_.VesselVelocity(active_vessel.id.ToString()))
                  .magnitude.ToString("F1") + "m/s";
                }

                // Orient the Frenet trihedron.
                Vector3d prograde =
                (Vector3d)plugin_.VesselTangent(active_vessel.id.ToString());
                Vector3d radial =
                (Vector3d)plugin_.VesselNormal(active_vessel.id.ToString());
                // Yes, the astrodynamicist's normal is the mathematician's binormal.
                // Don't ask.
                Vector3d normal =
                (Vector3d)plugin_.VesselBinormal(active_vessel.id.ToString());

                SetNavballVector(navball_.progradeVector, prograde);
                SetNavballVector(navball_.radialInVector, radial);
                SetNavballVector(navball_.normalVector, normal);
                SetNavballVector(navball_.retrogradeVector, -prograde);
                SetNavballVector(navball_.radialOutVector, -radial);
                SetNavballVector(navball_.antiNormalVector, -normal);

                // Make the autopilot target our Frenet trihedron.
                if (active_vessel.OnAutopilotUpdate.GetInvocationList()[0] !=
                (Delegate)(FlightInputCallback)OverrideRSASTarget) {
                  Log.Info("Prepending RSAS override");
                  active_vessel.OnAutopilotUpdate =
                  (FlightInputCallback)Delegate.Combine(
                  new FlightInputCallback(OverrideRSASTarget),
                  active_vessel.OnAutopilotUpdate);
                }
                if (active_vessel.Autopilot.Enabled) {
                  override_rsas_target_ = true;
                  switch (active_vessel.Autopilot.Mode) {
                case VesselAutopilot.AutopilotMode.Prograde:
                  rsas_target_ = prograde;
                  break;
                case VesselAutopilot.AutopilotMode.Retrograde:
                  rsas_target_ = -prograde;
                  break;
                case VesselAutopilot.AutopilotMode.RadialIn:
                  rsas_target_ = radial;
                  break;
                case VesselAutopilot.AutopilotMode.RadialOut:
                  rsas_target_ = -radial;
                  break;
                case VesselAutopilot.AutopilotMode.Normal:
                  rsas_target_ = normal;
                  break;
                case VesselAutopilot.AutopilotMode.Antinormal:
                  rsas_target_ = -normal;
                  break;
                default:
                  override_rsas_target_ = false;
                  break;
                  }
                }
                  }
                }
            }