Пример #1
0
        public void Invoke(Command command)
        {
            var tCommand = command as T;

            Assert.IsNotNull(tCommand, $"typedMessage is null for: notice = {command.GetType().Name}, T = {typeof(T).Name}");
            if (action != null)
            {
                action.Invoke(tCommand);
            }
        }
 public bool AttemptToInvokeCommand(string key) // Command Action Response invokation in Scriptable object
 {
     if (commandDictionary.ContainsKey(key))
     {
         CommandAction action = commandDictionary[key];
         if (action != null)
         {
             action.Invoke();
             return(true);
         }
         else
         {
             Debug.LogWarning("No action assigned to " + key);
         }
     }
     return(false);
 }
Пример #3
0
 public void Invoke(string args)
 {
     command.Invoke(args);
 }
Пример #4
0
 public void Execute(object parameter)
 {
     CommandAction?.Invoke();
 }
 private void DoShowTaskCommand()
 {
     CommandAction?.Invoke();
     // do other stuff here...
 }
Пример #6
0
 protected virtual void YesCommand_Commandaction(object para)
 {
     DialogResult = true;
     yesAction?.Invoke(this);
     Close();
 }
Пример #7
0
 protected virtual void NoCommand_Commandaction(object para)
 {
     DialogResult = false;
     noAction?.Invoke(this);
     Close();
 }