Exemple #1
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var director = directorReference.Resolve(context.ReferenceResolver);

            if (!director)
            {
                throw new NullReferenceException();
            }

            switch (control)
            {
            case ControlType.Resume:
                director.Resume();
                break;

            case ControlType.Pause:
                director.Pause();
                break;

            case ControlType.Stop:
                director.Stop();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            handle.Complete();
        }
Exemple #2
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var dialog = context.GetModule <DialogModule>();

            if (dialog == default)
            {
                context.RaiseError(new ScriptExecutionException("DialogModuleが登録されていません。"));
                return;
            }

            if (dialog.CurrentProvider != null)
            {
                var providerName = dialog.CurrentProvider.ProviderName;

                dialog.Close(() =>
                {
                    var script                = new EventScript();
                    script.CommandList        = commandList;
                    script.WaitForAllCommands = true;
                    context.InsertInherit(script, () => { dialog.Open(providerName, handle.Complete); });
                });
            }
            else
            {
                var script = new EventScript();
                script.CommandList        = commandList;
                script.WaitForAllCommands = true;
                context.InsertInherit(script, handle.Complete);
            }
        }
Exemple #3
0
        private async UniTaskVoid ExecuteAsync(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var timelineModule = context.GetModule <TimelineModule>();

            if (!timelineModule)
            {
                throw new NullReferenceException();
            }

            var cs = new UniTaskCompletionSource();

            Action <SignalAsset> onSignalNotify = signalAsset =>
            {
                if (signalAsset == target)
                {
                    cs.TrySetResult();
                }
            };

            timelineModule.OnSignalNotify += onSignalNotify;

            await PlayNestedCommands(context);

            await cs.Task;

            timelineModule.OnSignalNotify -= onSignalNotify;

            handle.Complete();
        }
Exemple #4
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var dialog = context.GetModule <DialogModule>();

            if (dialog == default)
            {
                context.RaiseError(new ScriptExecutionException("DialogModuleが登録されていません。"));
                return;
            }

            dialog.Cut.Show(sprite, duration, updateMode, handle.Complete);
        }
Exemple #5
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var dialog = context.GetModule <DialogModule>();

            if (dialog == default)
            {
                context.RaiseError(new ScriptExecutionException("DialogSessionが登録されていません。"));
                return;
            }


            dialog.ShowMessage(settings, () => { handle.Complete(); });
        }
Exemple #6
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            Debug.Log("SampleEventCommand3: ネストされたイベントを実行します。");
            var script = new EventScript();

            script.WaitForAllCommands = false;
            script.CommandList        = commandList;

            context.InsertInherit(script, () =>
            {
                Debug.Log("SampleEventCommand3: ネストの終了。");
                handle.Complete();
            });
        }
Exemple #7
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var obj = targetGameObject.Resolve(context.ReferenceResolver);

            if (obj)
            {
                Debug.Log($"シーン参照に成功しました。: {obj.name}", obj);
            }
            else
            {
                Debug.Log($"シーン参照に失敗しました。");
            }

            handle.Complete();
        }
Exemple #8
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var dialog = context.GetModule <DialogModule>();

            if (dialog == default)
            {
                context.RaiseError(new ScriptExecutionException("DialogSessionが登録されていません。"));
                return;
            }

            string[] items    = bifurcations.Select(b => b.Label).ToArray();
            var      settings = new DialogShowMenuSettings(items);

            dialog.ShowMenu(settings, (index) =>
            {
                var script = new EventScript();
                script.WaitForAllCommands = false;
                script.CommandList        = bifurcations[index].CommandList;
                context.InsertInherit(script, handle.Complete);
            });
        }
Exemple #9
0
        public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var dialog = context.GetModule <DialogModule>();

            if (dialog == default)
            {
                context.RaiseError(new ScriptExecutionException("DialogModuleが登録されていません。"));
                return;
            }

            dialog.Fade.In(inDuration, () =>
            {
                var script = new EventScript()
                {
                    CommandList        = nestedCommands,
                    WaitForAllCommands = true
                };
                context.InsertInherit(script, () =>
                {
                    dialog.Fade.Out(outDuration, handle.Complete);
                });
            });
        }
Exemple #10
0
        private async UniTaskVoid ExecuteAsync(EventExecutionContext context, CommandExecutionHandle handle)
        {
            var timelineModule = context.GetModule <TimelineModule>();

            if (!timelineModule)
            {
                throw new NullReferenceException();
            }

            var director = directorReference.Resolve(context.ReferenceResolver);

            if (!director)
            {
                throw new NullReferenceException();
            }

            var timelinePlaying = PlayTimeline(director, timelineModule);

            await PlayNestedCommands(context);

            await timelinePlaying;

            handle.Complete();
        }
Exemple #11
0
 public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
 {
     ExecuteAsync(context, handle).Forget();
 }
Exemple #12
0
 public override void Execute(EventExecutionContext context, CommandExecutionHandle handle)
 {
     Debug.Log("SampleEventCommand1 executed!");
     handle.Complete();
 }