Example #1
0
    void Start()
    {
        //Check if already saved a texture in disk with key "myTexture"
        if (TextureUtilities.IsTextureSaved("myTexture"))
        {
            //Load saved texture
            imageTextureCopy = TextureUtilities.Load("myTexture");

            //Assign loaded texture to your sprite
            imageSprite.sprite = TextureUtilities.GetSpriteFromTexture(imageTextureCopy);
        }

        //Get texture copy in order to manipulate its data and pixels.
        //you can't access texture data directly, it will throw an error : (Texture is not readable)
        imageTextureCopy = TextureUtilities.GetTextureCopy(imageSprite.sprite.texture);
    }