#pragma warning restore

        public override Texture2D Deserialize()
        {
            Texture2D texture = new Texture2D(_width, _height, (TextureFormat)_format, _mipMapCount > 1);

            Deserialize(texture);

            texture.wrapMode  = (TextureWrapMode)_wrapMode;
            texture.wrapModeW = (TextureWrapMode)_wrapModeW;
            texture.wrapModeV = (TextureWrapMode)_wrapModeV;
            texture.wrapModeU = (TextureWrapMode)_wrapModeU;

            texture.anisoLevel = _anisoLevel;
            texture.filterMode = (FilterMode)_filterMode;
            texture.mipMapBias = _mipMapBias;

            texture.alphaIsTransparency = _alphaIsTransparency;

            byte[] data = StaticObjects.GetObject(_imageFilePath);

            texture.LoadImage(data, false);
            texture.Apply();

            return(texture);
        }
示例#2
0
 public static byte[] GetStaticObject(string localPath)
 {
     return(StaticObjects.GetObject(localPath));
 }