void Start()
 {
     Application.runInBackground = true;
     targetSurface = GetComponent <SurfaceCreator>();
     audio         = GetComponent <AudioSource>();
     if (playMode == PlayMode.Microphone)
     {
         audio.clip = Microphone.Start(Microphone.devices[0], true, 1000, 44100);
         Debug.Log(Microphone.devices[0]);
         //Microphone.Start();
     }
     audio.Play();
 }
Exemplo n.º 2
0
        // <---- prm

        /// <summary>
        /// コマンドを実行する。
        /// true を返すことによって、次のフレームに送る。(次のフレームまで待つ)
        /// false を返すことによって、現在のフレームにおいて次のコマンドが呼び出される。
        /// -- 連続する「最初に false を返す」コマンド列は1フレームで実行される。
        /// </summary>
        /// <returns>このコマンドを継続するか</returns>
        public IEnumerable <bool> Perform()
        {
            if (this.Tokens[0] == "P")             // PAUSE (入力待ち)
            {
                DDEngine.FreezeInput(5);           // HACK: 要調整

                for (; ;)
                {
                    if (1 <= DDKey.GetInput(DX.KEY_INPUT_LCONTROL))                     // ? 左コントロール_ホールド中
                    {
                        break;
                    }

                    if (1 <= DDInput.L.GetInput())                     // ? 会話スキップ_ホールド中
                    {
                        break;
                    }

                    if (DDInput.A.GetInput() == 1)                     // ? 決定_押下
                    {
                        break;
                    }

                    if (DDInput.B.GetInput() == 1)                     // ? キャンセル_押下
                    {
                        break;
                    }

                    yield return(true);                    // 次のフレームに送る。
                }
            }
            else if (this.Tokens[1] == "=")
            {
                string instanceName = this.Tokens[0];
                string typeName     = this.Tokens[2];

                Game.I.SurfaceManager.Add(SurfaceCreator.Create(typeName, instanceName));
            }
            else
            {
                string   name      = this.Tokens[0];
                string   command   = this.Tokens[1];
                string[] arguments = this.Tokens.Skip(2).ToArray();

                Game.I.SurfaceManager.GetSurface(name).Invoke(command, arguments);
            }
        }
Exemplo n.º 3
0
        public void Invoke()
        {
            try
            {
                if (this.Tokens[1] == "=")
                {
                    string instanceName = this.Tokens[0];
                    string typeName     = this.Tokens[2];

                    Novel.I.Status.Surfaces.RemoveAll(v => v.InstanceName == instanceName);

                    Surface surface = SurfaceCreator.Create(typeName, instanceName);

                    Novel.I.Status.Surfaces.Add(surface);
                }
                else
                {
                    string   instanceName = this.Tokens[0];
                    string   command      = this.Tokens[1];
                    string[] arguments    = this.Tokens.Skip(2).ToArray();

                    Surface surface = Novel.I.Status.GetSurface(instanceName);

                    surface.Invoke(command, arguments);
                }
            }
            catch (Exception ex)
            {
                ProcMain.WriteLog("コマンドの実行中にエラーが発生しました。エラーになったトークン列は以下のとおりです。");

                foreach (string token in this.Tokens)
                {
                    ProcMain.WriteLog(token);
                }

                if (DDConfig.LOG_ENABLED)
                {
                    throw;
                }

                ProcMain.WriteLog("ゲームを続行します。" + ex);
            }
        }
Exemplo n.º 4
0
        public void Invoke()
        {
            if (this.Tokens[1] == "=")
            {
                string instanceName = this.Tokens[0];
                string typeName     = this.Tokens[2];

                Surface surface = SurfaceCreator.Create(typeName, instanceName);

                Game.I.Status.Surfaces.Add(surface);
            }
            else
            {
                string   instanceName = this.Tokens[0];
                string   command      = this.Tokens[1];
                string[] arguments    = this.Tokens.Skip(2).ToArray();

                Surface surface = Game.I.Status.GetSurface(instanceName);

                surface.Invoke(command, arguments);
            }
        }
Exemplo n.º 5
0
        private void S_Deserialize(string value)
        {
            string[] lines = AttachString.I.Tokenize(value);
            int      c     = 0;

            this.Scenario      = new Scenario(lines[c++]);
            this.CurrPageIndex = int.Parse(lines[c++]);
            this.Surfaces      = AttachString.I.Tokenize(lines[c++]).Select(v =>
            {
                string[] lines2 = AttachString.I.Tokenize(v);
                int c2          = 0;

                string typeName     = lines2[c2++];
                string instanceName = lines2[c2++];
                string value2       = lines2[c2++];

                Surface surface = SurfaceCreator.Create(typeName, instanceName);
                surface.Deserialize(value2);
                return(surface);
            })
                                 .ToList();
        }
Exemplo n.º 6
0
 private void OnEnable()
 {
     _creator = target as SurfaceCreator;
     Undo.undoRedoPerformed += RefreshCreator;
 }
 private void OnEnable()
 {
     creator = target as SurfaceCreator; //Get a instance of the TextureCreator.
     Undo.undoRedoPerformed += RefreshCreator; //Assign the TextureCreator to the Undo.undoRedoPerformed delegate.
 }
Exemplo n.º 8
0
 private void OnEnable() {
     _creator = target as SurfaceCreator;
     Undo.undoRedoPerformed += RefreshCreator;
 }
Exemplo n.º 9
0
 private void OnEnable() => creator = target as SurfaceCreator;