Exemple #1
0
    public static IEnumerator processCSV(bool[] loadDone, TextAsset csv, setterDelegate setter, bool matchLineWithExcel)
    {
        //print("parsing " + csv.name);
        string[,] data = CSVReader.SplitCsvGrid(csv.text, matchLineWithExcel);

        setter(data);
        while (!(data.Length > 0))
        {
            yield return(null);
        }

        loadDone[0] = true;
    }
Exemple #2
0
    /// <summary>
    /// assumes quest's setupFilePath is a valid csv
    ///
    /// setupDataRef is a double array that contains chunks of events to this quest
    /// </summary>
    /// <returns></returns>
    IEnumerator assignQuestSetupData(Quest q, setterDelegate setter)
    {
        print("quest setup " + q.description);

        TextAsset setupCSV = Resources.Load <TextAsset>("Quests/Setup/" + q.setupFilePath);

        if (!setupCSV)
        {
            Debug.LogError("invalid csv path: " + "Quests/Setup/" + q.setupFilePath);
        }

        bool[] done = new bool[1];

        yield return(LoadScene.processCSV(done, setupCSV, setter, true)); //keep same numbering as in excel sheet
    }