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(); }
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); } }
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(); }
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); }
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(); }); }
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(); }); }
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(); }
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); }); }
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); }); }); }
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(); }
public override void Execute(EventExecutionContext context, CommandExecutionHandle handle) { ExecuteAsync(context, handle).Forget(); }
public override void Execute(EventExecutionContext context, CommandExecutionHandle handle) { Debug.Log("SampleEventCommand1 executed!"); handle.Complete(); }