static int set_dimension(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.RenderTexture obj = (UnityEngine.RenderTexture)o;
            UnityEngine.Rendering.TextureDimension arg0 = (UnityEngine.Rendering.TextureDimension)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rendering.TextureDimension));
            obj.dimension = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index dimension on a nil value"));
        }
    }
    static int get_dimension(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.RenderTexture obj = (UnityEngine.RenderTexture)o;
            UnityEngine.Rendering.TextureDimension ret = obj.dimension;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index dimension on a nil value" : e.Message));
        }
    }
Ejemplo n.º 3
0
        static StackObject *set_dimension_12(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.Rendering.TextureDimension @value = (UnityEngine.Rendering.TextureDimension) typeof(UnityEngine.Rendering.TextureDimension).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.dimension = value;

            return(__ret);
        }
Ejemplo n.º 4
0
            public virtual void Deserialize(BinaryReader binaryReader)
            {
#if UNITY_2019_1_OR_NEWER
                m_flags = (UnityEngine.Rendering.ShaderPropertyFlags)binaryReader.ReadInt32();
                m_type  = (UnityEngine.Rendering.ShaderPropertyType)binaryReader.ReadInt32();
#endif
                m_textureDimension = (UnityEngine.Rendering.TextureDimension)binaryReader.ReadInt32();
                m_dirty            = binaryReader.ReadBoolean();
                m_nameId           = binaryReader.ReadInt32();
                m_floatValue       = binaryReader.ReadSingle();
                m_displayName      = binaryReader.ReadString();
                m_name             = binaryReader.ReadString();
                m_colorValue       = SerializerKun.DesirializeObject <ColorKun>(binaryReader);
                m_textureValue     = SerializerKun.DesirializeObject <TextureKun>(binaryReader);
                m_rangeLimits      = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_scale            = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_offset           = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader);
                m_vectorValue      = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader);
            }
Ejemplo n.º 5
0
    static int set_dimension(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Texture.dimension");
#endif
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Texture obj = (UnityEngine.Texture)o;
            UnityEngine.Rendering.TextureDimension arg0 = (UnityEngine.Rendering.TextureDimension)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rendering.TextureDimension));
            obj.dimension = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index dimension on a nil value"));
        }
    }
Ejemplo n.º 6
0
    static int get_dimension(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Texture.dimension");
#endif
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Texture obj = (UnityEngine.Texture)o;
            UnityEngine.Rendering.TextureDimension ret = obj.dimension;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index dimension on a nil value"));
        }
    }
Ejemplo n.º 7
0
        /// <summary>
        /// Deserialize
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        public override void Deserialize(BinaryReader binaryReader)
        {
            base.Deserialize(binaryReader);
#if UNITY_2019_1_OR_NEWER
            m_graphicsFormat = (UnityEngine.Experimental.Rendering.GraphicsFormat)binaryReader.ReadInt32();
            m_mipmapCount    = binaryReader.ReadInt32();
#endif
            m_anisoLevel  = binaryReader.ReadInt32();
            m_dimension   = (UnityEngine.Rendering.TextureDimension)binaryReader.ReadInt32();
            m_filterMode  = (FilterMode)binaryReader.ReadInt32();
            m_height      = binaryReader.ReadInt32();
            m_isReadable  = binaryReader.ReadBoolean();
            m_mipMapBias  = binaryReader.ReadSingle();
            m_updateCount = binaryReader.ReadUInt32();
            m_width       = binaryReader.ReadInt32();
            m_wrapMode    = (TextureWrapMode)binaryReader.ReadInt32();
            m_wrapModeU   = (TextureWrapMode)binaryReader.ReadInt32();
            m_wrapModeV   = (TextureWrapMode)binaryReader.ReadInt32();
            m_wrapModeW   = (TextureWrapMode)binaryReader.ReadInt32();
        }
        static StackObject *set_dimension_15(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.Rendering.TextureDimension @value = (UnityEngine.Rendering.TextureDimension) typeof(UnityEngine.Rendering.TextureDimension).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.RenderTextureDescriptor instance_of_this_method;
            instance_of_this_method = (UnityEngine.RenderTextureDescriptor) typeof(UnityEngine.RenderTextureDescriptor).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            instance_of_this_method.dimension = value;

            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            return(__ret);
        }
Ejemplo n.º 9
0
        public WXEffect(Shader _shader)
        {
            this.shader     = (Shader)_shader;
            this.properties = new List <property>();
            this.textures   = new List <property>();
            int instanceID = shader.GetInstanceID();

            unityAssetPath = AssetDatabase.GetAssetPath(instanceID);

            this.property_count = ShaderUtil.GetPropertyCount(shader);

            for (int i = 0; i < property_count; i++)
            {
                string name     = ShaderUtil.GetPropertyName(shader, i);
                string typeName = "";
                ShaderUtil.ShaderPropertyType type = ShaderUtil.GetPropertyType(shader, i);
                JSONObject defaultValue            = new JSONObject(0);
                switch (type)
                {
                case ShaderUtil.ShaderPropertyType.Float:
                case ShaderUtil.ShaderPropertyType.Range:
                    typeName     = "Float";
                    defaultValue = new JSONObject(JSONObject.Type.ARRAY);
                    defaultValue.Add(0);
                    break;

                case ShaderUtil.ShaderPropertyType.Vector:
                    typeName     = "Vector4";
                    defaultValue = new JSONObject(JSONObject.Type.ARRAY);
                    defaultValue.Add(0); defaultValue.Add(0);
                    defaultValue.Add(0); defaultValue.Add(1);
                    break;

                case ShaderUtil.ShaderPropertyType.Color:
                    typeName     = "Vector4";
                    defaultValue = new JSONObject(JSONObject.Type.ARRAY);
                    defaultValue.Add(1); defaultValue.Add(1);
                    defaultValue.Add(1); defaultValue.Add(1);
                    break;

                case ShaderUtil.ShaderPropertyType.TexEnv:
                    typeName     = "unresolved_tex";
                    defaultValue = JSONObject.CreateStringObject("white");
                    break;
                }
                if (typeName == "")
                {
                    continue;
                }
                if (typeName == "unresolved_tex")
                {
                    UnityEngine.Rendering.TextureDimension texType = ShaderUtil.GetTexDim(shader, i);
                    switch (texType)
                    {
                    case UnityEngine.Rendering.TextureDimension.Tex2D:
                        typeName = "Texture2D";
                        break;

                    case UnityEngine.Rendering.TextureDimension.Cube:
                        typeName = "TextureCube";
                        break;
                    }
                    if (typeName == "unresolved_tex")
                    {
                        continue;
                    }
                    this.textures.Add(new property {
                        key = name, type = typeName, defaultValue = defaultValue
                    });
                }
                else
                {
                    this.properties.Add(new property {
                        key = name, type = typeName, defaultValue = defaultValue
                    });
                }
            }
        }