コード例 #1
0
    private void PlayNext()
    {
        if (_activeMonologInstance != null)
        {
            _activeMonologInstance.Hide();
        }

        _sceneActionIndex++;
        if (_missionScene.DialogData.Length > _sceneActionIndex)
        {
            _activeMonologInstance = _monologInstances[_missionScene.DialogData[_sceneActionIndex].PrefabPath];
            _activeMonologInstance.Show(_missionScene.DialogData[_sceneActionIndex], PlayNext);
        }
        else
        {
            End();
        }
    }
コード例 #2
0
    private void End()
    {
        Action callback = _callback;

        _missionScene     = null;
        _callback         = null;
        _sceneActionIndex = -1;

        _activeMonologInstance = null;
        foreach (KeyValuePair <string, UnitMonolog> kvp in _monologInstances)
        {
            if (kvp.Value != null)
            {
                GameObject.Destroy(kvp.Value.gameObject);
            }
        }
        _monologInstances.Clear();
        _monologInstances = null;

        callback();
    }