Example #1
0
    public static Texture LoadMissionPic(string pic_name)
    {
        Texture2D tex  = null;
        string    path = Misc.GetPersistentDataPath() + MISSION_PIC_PATH + pic_name;

        byte[] _data = CFile.ReadBinaryFile(path);

        if (_data == null)
        {
            Debug.LogError("file is not exist");
        }
        tex = new Texture2D(Consts.PIC_WIDTH, Consts.PIC_HIGHT, TextureFormat.RGBA32, false);
        tex.LoadRawTextureData(_data);
        tex.Apply();
        return(tex);
    }