Esempio n. 1
0
    public Sprite QuickLoadSpriteFromFile(string fileName)
    {
        Debug.Log("Loading " + fileName);
        Stopwatch sw = new Stopwatch();

        sw.Start();
        Sprite sprite = QuickSaveRoot.Load <Sprite>(fileName, quickSaveSettings);

        sw.Stop();
        Debug.Log("Time to load sprite " + fileName + " :" + sw.Elapsed);
        return(sprite);
    }
    public void QuickSaveRootExample()
    {
        // Use QuickSaveRoot to save / load individual objects to / from their own files

        Texture2D texture2D = new Texture2D(1, 1);

        texture2D.LoadImage(new byte[] { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 });
        texture2D.Apply();

        QuickSaveRoot.Save("RootName", texture2D);

#pragma warning disable 0219
        Texture2D loaded = QuickSaveRoot.Load <Texture2D>("RootName");
#pragma warning restore 0219
    }