Пример #1
0
        private void CheckOrderPress(Vector2 mouseWorldPosition)
        {
            var orderHolder = OrderManager.instance.GetOrder(mouseWorldPosition);

            if (orderHolder == null)
            {
                return;
            }

            ComboManager.instance.SkipNext();
            controlledOrderHolder = orderHolder;
            if (orderHolder.coroutine != null)
            {
                orderHolder.coroutineAuthor.StopCoroutine(orderHolder.coroutine);
                orderHolder.coroutine = null;
            }
            orderHolder.coroutineAuthor = this;
            orderHolder.coroutine       = StartCoroutine(ControllOrder(orderHolder.order));
        }
Пример #2
0
 private void CheckOrderRelease(Vector2 mouseWorldPosition)
 {
     if (controlledOrderHolder != null)
     {
         controlledOrderHolder.coroutineAuthor.StopCoroutine(controlledOrderHolder.coroutine);
         controlledOrderHolder.coroutine = null;
         // If dish created correctly
         var order = controlledOrderHolder.order;
         if (DishManager.instance.CheckIfCorrect(order))
         {
             OrderManager.instance.RemoveOrder(controlledOrderHolder);
             controlledOrderHolder = null;
             DishManager.instance.OnDishFin(order);
             return;
         }
         // If not
         controlledOrderHolder.coroutineAuthor = this;
         controlledOrderHolder.coroutine       = StartCoroutine(
             Lerps.MoveLerp(controlledOrderHolder.order.transform, controlledOrderHolder.regularPos, 0.2f, Lerps.Normalizators.Squared)
             );
         controlledOrderHolder = null;
     }
 }