Exemplo n.º 1
0
        static string _GetProperty(MToonMaterial mtoon, MaterialBindType bindType)
        {
            switch (bindType)
            {
            // case MaterialBindType.UvOffset:
            // case MaterialBindType.UvScale:
            //     return UV_PROPERTY;

            case MaterialBindType.Color:
                return(COLOR_PROPERTY);

            case MaterialBindType.EmissionColor:
                return(EMISSION_COLOR_PROPERTY);

            case MaterialBindType.ShadeColor:
                return(SHADE_COLOR_PROPERTY);

            case MaterialBindType.RimColor:
                return(RIM_COLOR_PROPERTY);

            case MaterialBindType.OutlineColor:
                return(OUTLINE_COLOR_PROPERTY);
            }

            throw new NotImplementedException();
        }
Exemplo n.º 2
0
        static string _GetProperty(UnlitMaterial unlit, MaterialBindType bindType)
        {
            switch (bindType)
            {
            // case MaterialBindType.UvOffset:
            // case MaterialBindType.UvScale:
            //     return UV_PROPERTY;

            case MaterialBindType.Color:
                return(COLOR_PROPERTY);
            }

            throw new NotImplementedException();
        }
Exemplo n.º 3
0
        static string _GetProperty(PBRMaterial pbr, MaterialBindType bindType)
        {
            switch (bindType)
            {
            // case MaterialBindType.UvOffset:
            // case MaterialBindType.UvScale:
            //     return UV_PROPERTY;

            case MaterialBindType.Color:
                return(COLOR_PROPERTY);

            case MaterialBindType.EmissionColor:
                return(EMISSION_COLOR_PROPERTY);
            }

            throw new NotImplementedException();
        }
Exemplo n.º 4
0
        public static string GetProperty(this MaterialBindType bindType, Material material)
        {
            if (material is MToonMaterial mtoon)
            {
                return(_GetProperty(mtoon, bindType));
            }

            if (material is UnlitMaterial unlit)
            {
                return(_GetProperty(unlit, bindType));
            }

            if (material is PBRMaterial pbr)
            {
                return(_GetProperty(pbr, bindType));
            }

            throw new NotImplementedException();
        }
Exemplo n.º 5
0
 public MaterialBindValue(Material material, MaterialBindType bindType, Vector4 value)
 {
     Material = material;
     BindType = bindType;
     Value    = value;
 }
Exemplo n.º 6
0
        // public MaterialBindValue(Material material, String property, Vector4 value)
        // {
        //     Material = material;
        //     BindType = material.GetBindType(property);
        //     m_value = value;
        // }

        public MaterialColorBind(Material material, MaterialBindType bindType, Vector4 value)
        {
            Material = material;
            BindType = bindType;
            m_value  = value;
        }