private void OnOrderAdded(Order obj) { Order_UI order = (Order_UI)order_UIPool.Request(); order.SetOrder(obj); orders.Add(order); order.transform.SetParent(ordersParent, false); }
private void OnOrderDelivered(bool correct, int points) { if (!correct) { Transform mistake = mistakes_UIPool.Request().transform; mistake.SetParent(mistakesParent, false); } }
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; }
public override void OnGrab(Grabber grabber, Transform pivot) { var obj = pool.Request(); obj.GetComponent <Grabbable>().OnGrab(grabber, pivot); }