Ejemplo n.º 1
0
    public void StartEvent()
    {
        _readNow = true;

        try
        {
            _nowCodeData = _codeList.Dequeue();
            _nowCodeData.CodeAction();
        }
        catch (System.InvalidOperationException)
        {
            _nowCodeData = new EndCode();
        }
    }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (_readNow)
     {
         if (_nowCodeData.IsEndCode())
         {
             var get = _nowCodeData.GetNextCode();
             if (get != null)
             {
                 _codeList = InsertQueue(get);
             }
             if (_codeList.Count > 0)//継続
             {
                 _nowCodeData = _codeList.Dequeue();
                 _nowCodeData.CodeAction();
             }
             else//nextEVがなければ終了
             {
                 var next = _nowScriptable.GetNextCode();
                 if (next == null ||
                     string.IsNullOrEmpty(next.GetData()) ||
                     !next.CoalEnable())
                 {
                     EndEvent();
                     ResetFlashData();
                 }
                 else
                 {
                     SetEventData(next);
                     _nowCodeData = _codeList.Dequeue();
                     _nowCodeData.CodeAction();
                 }
             }
         }
     }
 }