예제 #1
0
    public IEnumerator LoadAnims()
    {
        for (int i = 0; i < Data.Instance.configData.config.maxSavedAnims; i++)
        {
            string data = PlayerPrefs.GetString(saveName + i);
            //Debug.Log (i + ": |"+data+"|");
            if (data == "")
            {
                i = Data.Instance.configData.config.maxSavedAnims;
            }
            else
            {
                string[] pData = data.Split(dataSeparator);
                //Debug.Log (pData.Length);
                string path       = pData [0];
                string animID     = pData [1];
                int    frameCount = int.Parse(pData [2]);
                Anim   a          = new Anim();
                a.id = "" + i;
                for (int j = 0; j < frameCount; j++)
                {
                    a.AddFrame(TextureUtils.LoadLocal(path + "\\" + saveName + nameSeparator + i + nameSeparator + j + imageFileExtension), j);
                }

                anims.Add(a);
            }
        }

        if (anims.Count > 0)
        {
            Data.Instance.timelineManager.PlaySaved();
        }

        yield return(null);
    }