Beispiel #1
0
    // Use this for initialization
    protected override void Start()
    {
        Debug.Log("//-*start");
#if true
        //-*シナリオデバッグ
        m_gameData.AdvNextScoNo = "13";
#endif
        m_Mode = ADVENTUREMODE.aMODE_INIT;
        StartCoroutine("UpdateAdventure");
    }
Beispiel #2
0
    /// <summary>
    /// シナリオコマンド処理
    /// true:ページ区切りまで処理した
    /// </summary>
    private void ScenarioReadUpdate()
    {
        //-*
        if (m_isPageWait)
        {
            return;
        }
        string scoLineText = m_textData[m_textLineNum];
        var    cmd         = ScenarioRead(scoLineText);

        Debug.Log("//-********(" + cmd + ")");
        switch (cmd)
        {
        case AdvDefine.CMD_TYPE.CMD_PAGEEND:
            // ページ区切り
            // PageInit();
            m_isPageWait = true;
            break;

        case AdvDefine.CMD_TYPE.CMD_SPEAKER_DEL:
            // 発言者名:消す
            m_SpeakerNames.SetActive(false);
            break;

        case AdvDefine.CMD_TYPE.CMD_SPEAKER_MOE:
            // 発言者名:萌(萌日記)
            m_SpeakerNames.SetActive(true);
            break;

        case AdvDefine.CMD_TYPE.CMD_BG:
            // 背景
            m_bgObjBase.SetActive(true);
            if (m_bgScript != null)
            {
                m_gameData.AdvBgNo = GetScoCmdNo(scoLineText, cmd);
                m_bgScript.ImageChange(m_gameData.AdvBgNo);
                // m_bgScript.ImageChange("adventure/moema_bg00");
            }
            break;

        case AdvDefine.CMD_TYPE.CMD_EV_BG:
            // イベント背景
            m_bgObjBase.SetActive(true);
            if (m_bgScript != null)
            {
                m_gameData.AdvBgNo = GetScoCmdNo(scoLineText, cmd);
                m_bgScript.ImageChange(m_gameData.AdvBgNo, true);
                // m_bgScript.ImageChange("adventure/moema_bg00");
            }
            break;

        case AdvDefine.CMD_TYPE.CMD_BGM:
            // BGM再生
            string name = String.Concat(Dir.SOUND_BGM_BASE_NAME, GetScoCmdNo(scoLineText, cmd), ".ogg");
            m_gameData.SoundCtl.PlayBgm(name);
            break;

        case AdvDefine.CMD_TYPE.CMD_BGM_END:
            // BGM終了:未実装
            break;

        case AdvDefine.CMD_TYPE.CMD_CH:
            // キャラ
            Debug.Log("//-*CMD_TYPE.CMD_CH");
            m_charaObjBase.SetActive(true);
            if (m_CharaScript != null)
            {
                var imageName = GetScoCmdNo(scoLineText, AdvDefine.CMD_TYPE.CMD_CH);;
                m_CharaScript.ImageCharaSet(imageName);
                m_CharaScript.ImageFaceSet(imageName);
            }
            break;

        case AdvDefine.CMD_TYPE.CMD_CH_FACE:
            // 表情
            if (m_CharaScript != null)
            {
                int imageName = -1;
                if (int.TryParse(GetScoCmdNo(scoLineText, AdvDefine.CMD_TYPE.CMD_CH_FACE), out imageName))
                {
                    if (imageName < 0)
                    {
                        return;
                    }
                    m_CharaScript.ImageFaceChangeExpression(imageName);
                }
            }
            break;

        case AdvDefine.CMD_TYPE.CMD_GO_BATTLE:
            SetMahjongInGameData(scoLineText, AdvDefine.CMD_TYPE.CMD_GO_BATTLE);
            // InGame(麻雀)へ
            break;

        case AdvDefine.CMD_TYPE.CMD_CHOICE_START:
            // 選択肢開始
            ChoiceWaitInit();
            SetChoiceSentence();
            break;

        case AdvDefine.CMD_TYPE.CMD_FADE_IN:
        case AdvDefine.CMD_TYPE.CMD_FADE_OUT:
            // フェードインフェードアウト
            ChoiceWaitInit();
            SetChoiceSentence();
            break;

        case AdvDefine.CMD_TYPE.CMD_SCO_END:
            // シナリオ終了
            break;

        case AdvDefine.CMD_TYPE.NO_CMD_SENTENCE:
            // シナリオ本文
            Debug.Log("//-********m_pageLineNum(" + m_pageLineNum + ")→MAX:" + m_textLine.Length);
            if (m_pageLineNum < m_textLine.Length)
            {
                m_textLine[m_pageLineNum].text = m_textData[m_textLineNum];
                Debug.Log("//-*(" + m_pageLineNum + "):" + m_textLine[m_pageLineNum].text);
                m_pageLineNum++;
            }
            break;

        //-*********ココで読み込んだらエラーなコマンド
        case AdvDefine.CMD_TYPE.CMD_CHOICE:
        case AdvDefine.CMD_TYPE.CMD_CHOICE_END:
            // 選択肢
            // 選択肢終了
            m_Mode = ModeSet(ADVENTUREMODE.aMODE_EFFECT_ERR);
            break;

        default:
            m_Mode = ModeSet(ADVENTUREMODE.aMODE_EFFECT_WAIT);
            break;
        }
        m_textLineNum++;
    }
Beispiel #3
0
    private IEnumerator UpdateAdventure()
    {
        while (true)
        {
            switch (m_Mode)
            {
            case ADVENTUREMODE.aMODE_INIT:
                Debug.Log("//-*aMODE_INIT B");
                yield return(StartCoroutine("Init"));

                Debug.Log("//-*aMODE_INIT A");
                m_Mode = ModeSet(ADVENTUREMODE.aMODE_TEXT_DRAW);
                break;

            case ADVENTUREMODE.aMODE_TEXT_DRAW:
                ScenarioReadUpdate();
                if (m_isPageWait)
                {
                    PageWaitInit();
                    m_Mode = ModeSet(ADVENTUREMODE.aMODE_PAGE_WAIT);
                }
                else
                if (m_isChoiceWait)
                {
                    m_Mode = ModeSet(ADVENTUREMODE.aMODE_CHOICE_WAIT);
                }
                if (m_isEffectWait)
                {
                    m_Mode = ModeSet(ADVENTUREMODE.aMODE_EFFECT_WAIT);
                }
                break;

            case ADVENTUREMODE.aMODE_PAGE_WAIT:
                if (!m_isPageWait)
                {
                    PageWaitFin();
                    m_Mode = ModeSet(ADVENTUREMODE.aMODE_TEXT_DRAW);
                }
                break;

            case ADVENTUREMODE.aMODE_CHOICE_WAIT:
                if (!m_isChoiceWait)
                {
                    ChoiceWaitFin();
                    m_Mode     = ModeSet(ADVENTUREMODE.aMODE_EFFECT_WAIT);
                    m_ModeNext = ModeSet(ADVENTUREMODE.aMODE_INIT);
                }
                break;

            case ADVENTUREMODE.aMODE_EFFECT_WAIT:
                yield return(StartCoroutine(m_screenEffect.FadeOutStart(false)));

                yield return(StartCoroutine(m_screenEffect.FadeInStart(false)));

                m_Mode     = ModeSet(m_ModeNext);
                m_ModeNext = ModeSet(ADVENTUREMODE.aMODE_MAX);
                break;

            case ADVENTUREMODE.aMODE_EFFECT_ERR:                //-*シナリオエラー
            default:
                Debug.Log("//-*Err:" + m_Mode);

                break;
            }
            yield return(null);
        }
    }