示例#1
0
    private void OnOrderAdded(Order obj)
    {
        Order_UI order = (Order_UI)order_UIPool.Request();

        order.SetOrder(obj);
        orders.Add(order);
        order.transform.SetParent(ordersParent, false);
    }
示例#2
0
 private void OnOrderDelivered(bool correct, int points)
 {
     if (!correct)
     {
         Transform mistake = mistakes_UIPool.Request().transform;
         mistake.SetParent(mistakesParent, false);
     }
 }
示例#3
0
    public void SetOrder(Order order)
    {
        currentOrder = order;
        maxTime      = order.remaingTime;

        for (int i = 0; i < order.itens.Count; i++)
        {
            PoolableObject itemImage = itemImagePool.Request();
            Image          img       = itemImage.GetComponent <Image>();
            img.sprite = order.itens[i].sprite;
            itemImage.transform.SetParent(itemHolder);

            itemImages.Add(itemImage);
        }

        timer.fillAmount = 1;
    }
示例#4
0
    public override void OnGrab(Grabber grabber, Transform pivot)
    {
        var obj = pool.Request();

        obj.GetComponent <Grabbable>().OnGrab(grabber, pivot);
    }