Пример #1
0
    public static bool Save(Wrestler wrestler, string gameID)
    {
        string filename = WrestlerManager.GetFilename(gameID) + "?tag=" + wrestler.id;

        ES2.Save(wrestler, filename);
        return(true);
    }
Пример #2
0
    public static void DeleteSaved(string gameID)
    {
        string filename = WrestlerManager.GetFilename(gameID);

        if (ES2.Exists(filename))
        {
            ES2.Delete(filename);
        }

        if (WrestlerManager.Instance != null && SavedGameManager.Instance.IsGameLoaded() && gameID == SavedGameManager.Instance.CurrentGameID)
        {
            WrestlerManager.Instance.DestroyCurrentGameObjects();
        }
    }
Пример #3
0
    public static bool DeleteSaved(string id, string gameID)
    {
        string filename = WrestlerManager.GetFilename(gameID) + "?tag=" + id;

        if (ES2.Exists(filename))
        {
            ES2.Delete(filename);
            return(true);
        }
        else
        {
            Debug.LogError(string.Format("Unable to delete wrestler at {0}: No such file found", filename));
            return(false);
        }
    }
Пример #4
0
    public static bool Load(Wrestler wrestler, string id, string gameID)
    {
        string filename = WrestlerManager.GetFilename(gameID) + "?tag=" + id;

        if (ES2.Exists(filename))
        {
            ES2.Load <Wrestler>(filename, wrestler);
            wrestler.name = wrestler.wrestlerName;
            return(true);
        }
        else
        {
            Debug.LogError(string.Format("Unable to load wrestler from {0}: No such file found", filename));
            return(false);
        }
    }
Пример #5
0
    public void Load(string gameID)
    {
        DestroyCurrentGameObjects();

        string filename = WrestlerManager.GetFilename(gameID);

        if (ES2.Exists(filename))
        {
            string[] tags = ES2.GetTags(filename);
            foreach (string tag in tags)
            {
                Wrestler wrestler = CreateEmptyWrestler();
                Wrestler.Load(wrestler, tag, gameID);
                wrestlers.Add(wrestler);
            }
        }
    }