void OnClick() { ShopChestSlot cS = transform.parent.GetComponent <ShopChestSlot>(); if (cS.locked) { if (GameController.instance.level >= cS.unlocksAt) { cS.unlock(); } } else if (GameController.instance.gameState == (int)GameController.GameState.PREPARATION) { if (GameController.instance.gold >= cS.prefab.GetComponent <C_Chest>().goldCost) { NGUITools.SetActive(mobWindow, false); Bottombar.instance.startChestSpawnMode(cS.prefab); } } else { MessageBox.instance.showWarning("You can put chests only in the preparation phase!"); } }
void onHoldDown() { ShopChestSlot cS = transform.parent.GetComponent <ShopChestSlot>(); cS.prefab.GetComponent <C_Chest>().showTooltip(); }