Пример #1
0
    void initDR()
    {
        if (dr != null)
        {
            dr.Terminate();
        }

        if (dialogFileName == null)
        {
            GetSceneName();
            dialogFileName = Utility.sceneToFile[currScene];
        }

        string dialogPath = Utility.PrefixFile(dialogFileName.Trim());

        if (!dialogPath.EndsWith(".txt"))
        {
            dialogPath += ".txt";
        }

        if (scoreFileName == null)
        {
            scoreFileName = "scores.txt";
        }
        string scorePath = Utility.PrefixFile(scoreFileName.Trim());

        if (!scorePath.EndsWith(".txt"))
        {
            scorePath += ".txt";
        }

        dr = new DialogReader(dialogPath, scorePath);
        if (DialogReader.variables.Count == 0 || DialogReader.varNames.Count == 0)
        {
            dr.GetInitValues();
        }
        // if (dr.variables.Count == 0 || dr.varNames.Count == 0){
        //  dr.GetInitValues();
        // }
        Debug.Log("dr initialized");
    }