Exemple #1
0
    public void SetTalk(string name, int paragraph)
    {
        //check name and paragraph
        int iLine = 0;

        for (int i = 0; ; i++)
        {
            if (name == CSV.GetInstance().arrayData[i][0] && paragraph.ToString() == CSV.GetInstance().arrayData[i][1])
            {
                iLine = i;
                break;
            }
        }
        //set se
        if (CSV.GetInstance().arrayData[iLine][0] == "yellow" || CSV.GetInstance().arrayData[iLine][0] == "pizza")
        {
            _talky.talkSE = SoundManager.sound.uise.talk[0];
        }
        else
        {
            _talky.talkSE = SoundManager.sound.uise.talk[1];
        }

        int np; int.TryParse(CSV.GetInstance().arrayData[iLine][3], out np);//4th parameter

        _talky.SetNextTalk(CSV.GetInstance().arrayData[iLine][2], np);
        int storySize = CSV.GetInstance().arrayData[iLine].Length;

        _talky.SetStorySize(storySize - 4);
        string[] talkStory = _talky.story;
        for (int j = 4; j < storySize; j++)
        {//讀入第N段文字
            talkStory[j - 4] = CSV.GetInstance().arrayData[iLine][j];
        }
        _talky.SetCharsBG(_talky.CheckCharsNum(CSV.GetInstance().arrayData[iLine][0]));
    }