コード例 #1
0
 public async Task <string> SendCommandAsync(string[] arguments, CancellationToken cancel)
 {
     try
     {
         Running?.Invoke(this, arguments.Where(a => commands.Contains(a.ToLowerInvariant().Trim())).FirstOrDefault() ?? string.Empty);
         return(await _inner.SendCommandAsync(arguments, cancel));
     }
     finally
     {
         StoppedRunning?.Invoke(this, new EventArgs());
     }
 }
コード例 #2
0
    public void OnRun(InputAction.CallbackContext context)
    {
        switch (context.phase)
        {
        case InputActionPhase.Performed:
            StartedRunning.Invoke();
            break;

        case InputActionPhase.Canceled:
            StoppedRunning.Invoke();
            break;
        }
    }