示例#1
0
    private void LoadGameData()
    {
        string filePath = Application.dataPath + strategiesProjectFilePath;

        if (File.Exists(filePath))
        {
            string dataAsJson = File.ReadAllText(filePath);
            strategies = JsonUtility.FromJson <MatchUpData>(dataAsJson);
        }
        else
        {
            strategies = new MatchUpData();
        }
    }
示例#2
0
    private void LoadMatchData()
    {
        string filePath = Path.Combine(Application.streamingAssetsPath, matchDataFileName);

        if (File.Exists(filePath))
        {
            string dataAsJson = File.ReadAllText(filePath);
            matchUps = JsonUtility.FromJson <MatchUpData>(dataAsJson);
        }
        else
        {
            throw new Exception("Match up data not configured!");
        }
    }