// 자신의 상자 설정 public void AddChest(ChestKind kind, ChestState state = ChestState.Idle, string startTime = "", int index = 0) { if (curHaveChests == 3 || kind == ChestKind.NONE) { return; } myChests[index].chestKind = kind; myChests[index].chestState = state; if (startTime == "") { myChests[index].startTime = System.DateTime.Now; } else { myChests[index].startTime = System.DateTime.Parse(startTime); } myChests[index].disTime = 1; myChests[index].diamondPrice = ((int)kind + 1) * 10; myChests[index].idleTimeText.text = myChests[index].disTime + "분"; myChests[index].idleArenaText.text = myChests[index].chestKind.ToString(); myChests[index].disTimeText.text = myChests[index].disTime + "분"; myChests[index].disDiamondText.text = myChests[index].diamondPrice.ToString(); // 아레나 설정 등등 해주기 ... switch (myChests[index].chestState) { case ChestState.Idle: myChests[index].idleChest.SetActive(true); myChests[index].disChest.SetActive(false); myChests[index].openChest.SetActive(false); break; case ChestState.Dismissing: myChests[index].idleChest.SetActive(false); myChests[index].disChest.SetActive(true); myChests[index].openChest.SetActive(false); StartCoroutine(CheckingChest(index)); break; case ChestState.Open: myChests[index].idleChest.SetActive(false); myChests[index].disChest.SetActive(false); myChests[index].openChest.SetActive(true); break; default: break; } BackEndServerManager.instance.myInfo.haveChestKind[index] = (int)kind; BackEndServerManager.instance.myInfo.haveChestState[index] = (int)state; curHaveChests++; BackEndServerManager.instance.myInfo.haveChests = curHaveChests; BackEndServerManager.instance.myInfo.disStartTime = startTime; PlayerStats.instance.SaveChest(); }
public void OpenDiamondChest(ChestKind kind) { diamondChestDisObject.SetActive(false); OpenDiamondChestUI((int)kind); SetGoldUI(); }