Example #1
0
    public static byte[] LoadRaw(string identifier, ES2Settings settings)
    {
        ES2Settings newSettings = settings.Clone(identifier);

        using (ES2Reader reader = ES2Reader.Create(newSettings))
            return(reader.ReadRaw());
    }
Example #2
0
    public static Texture2D LoadImage(string path)
    {
        if (Application.platform == RuntimePlatform.WebGLPlayer)
        {
            Debug.LogError("Easy Save 2 Error: You cannot use LoadImage with WebGL");
        }

        ES2Settings settings = new ES2Settings(path);

        if (!settings.IsImageFile)
        {
            Debug.LogError("ES2.LoadImage can only be used to load JPG and PNG files.\nThe exception thrown is as follows:\n");
        }

        using (ES2Reader reader = ES2Reader.Create(settings))
            return(LoadImage(reader.ReadRaw()));
    }