Exemplo n.º 1
0
        /// <summary>
        /// 更新命令UI的状态
        /// </summary>
        IEnumerator UpdateCommandUIState()
        {
            //获取命令系统堆栈
            ICommandStack stack = _commandService.GetCommandStack();

            while (true)
            {
                if (stack.CanUndo())
                {
                    goUndo.GetComponent <Button>().interactable = true;
                }
                else
                {
                    goUndo.GetComponent <Button>().interactable = false;
                }

                if (stack.CanRedo())
                {
                    goRedo.GetComponent <Button>().interactable = true;
                }
                else
                {
                    goRedo.GetComponent <Button>().interactable = false;
                }
                yield return(new WaitForSeconds(0.3f));
            }
        }
Exemplo n.º 2
0
 public UnitOfWork(IQueryStack queryStack, ICommandStack commandStack)
 {
     QueryStack   = queryStack;
     CommandStack = commandStack;
 }
Exemplo n.º 3
0
 public UnitOfWork(ICommandStack commandStack)
 {
     CommandStack = commandStack;
 }
Exemplo n.º 4
0
 public UnitOfWork(IQueryStack queryStack, ICommandStack commandStack)
 {
     this.QueryStack = queryStack;
     this.CommandStack = commandStack;
 }