コード例 #1
0
ファイル: Choice.cs プロジェクト: Boufos/Captain
    public string Perform(ScoreContainer scoreContainer, CharacterScreen characterScreen)
    {
        if (ending == 1)
        {
            FindObjectOfType <DialogueContainer>().first = true;
        }
        if (ending == 2)
        {
            FindObjectOfType <DialogueContainer>().first = false;
        }
        if (lines.Count == currentLineIndex)
        {
            return("+");
        }
        string _line = lines[currentLineIndex];

        if (currentLineIndex == 0)
        {
            PerformAddition(scoreContainer);
        }

        if (currentLineIndex < lines.Count)
        {
            characterScreen.Draw(characters[currentLineIndex]);
        }
        currentLineIndex++;
        return(_line);
    }
コード例 #2
0
    public string GetLineOrChoice(int buttonIndex, ScoreContainer scoreContainer, ChoicesBox choicesBox, CharacterScreen characterScreen)
    {
        Debug.Log(_currentLineIndex);
        choicesBox.labels.Clear();
        string _line = "";

        if (_currentLineIndex == lines.Count - 1)
        {
            foreach (Choice choice in choices)
            {
                choicesBox.labels.Add(choice.label);
            }
        }
        else
        {
            choicesBox.labels.Add("Продолжить");
        }

        if (_currentLineIndex == lines.Count)
        {
            _recordedChoice = choices[buttonIndex];
            _line           = _recordedChoice.Perform(scoreContainer, characterScreen);
            _currentLineIndex++;
        }
        else if (_currentLineIndex > lines.Count)
        {
            _line = _recordedChoice.Perform(scoreContainer, characterScreen);
        }
        else
        {
            characterScreen.Draw(characters[_currentLineIndex]);
            _line = lines[_currentLineIndex];
            _currentLineIndex++;
        }
        return(_line);
    }