private void UpdateSelection(int previousX, int previousY, int x, int y) { _selectedSlot = _slots[previousX * 4 + previousY]; _selectedSlot.GetComponent <Image>().color = Color.white; _selectedSlot = _slots[x * 4 + y]; _selectedSlot.GetComponent <Image>().color = Color.red; _x = x; _y = y; }
private void Start() { _slots = new List <TrapSlot>(GetComponentsInChildren <TrapSlot>()); foreach (TrapSlot s in _slots) { s.SetIsShopSlot(true); } DisplayShop(); _selectedSlot = _slots[0]; UpdateSelection(_x, _y, _x, _y); }