IEnumerator ExcavatorProcess(int index) { Excavator e = ext[index]; while (e.tick * 0.1f < e.time) { yield return(new WaitForSeconds(0.1f)); e.tick++; e.progressWheel.value = (e.tick * e.progressWheel.maxValue * 0.1f) / e.time; } e.tick = 0; ExcavatorControl.Instance.ExcavatorOff(index); e.finishedFlag = true; NotificationText.Instance.AddNotification("Excavator0" + (index + 1) + " finish process."); }
static void Main(string[] args) { IExcavator excavator = new Excavator(); Console.WriteLine("Excavation starts...."); excavator.FilePath = $@"{AppDomain.CurrentDomain.BaseDirectory}\data\Jan-Oct2012.xlsx"; var date = new DateTime(2012, 1, 3); var data = excavator.GetStockDetailsByDate(date); Console.WriteLine($"{data.Count} rows found."); if (data != null && data.Any()) { var outputFile = $@"{AppDomain.CurrentDomain.BaseDirectory}\data\{date.ToString("yyyyMMdd")}\{date.ToString("yyyyMMdd")}.xlsx"; excavator.WriteFile(data, outputFile); } Console.WriteLine($"{data.Count} rows write in new file."); Console.Read(); }
// Update is called once per frame void Update() { RaycastHit hit; if (Physics.Raycast(FPSCam.transform.position, FPSCam.transform.forward, out hit, 2)) { string name = hit.collider.name; if (name.StartsWith("door1")) // button { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if (InventoryManager.Instance.HasItem(0)) { DoorsControl.Instance.OpenDoor(0); if (door1First) { UIFloatManager.Instance.ShowUI(2); door1First = false; } } else { NotificationText.Instance.AddNotification("Need Red Keycard"); } } } else if (name.StartsWith("door2")) // button { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if (InventoryManager.Instance.HasItem(1)) { DoorsControl.Instance.OpenDoor(1); } else { NotificationText.Instance.AddNotification("Need Green Keycard"); } } } else if (name.StartsWith("computer1")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if (computerFirst) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("computer")).SetText("Computer", "<ข้อความระบุว่า> \nบททดสอบพิเศษ \nเพื่อเตรียมพร้อมสู่การเป็นนัก STEM \nภารกิจ หาทางออกไปจากที่นี้\n < ตามคำใบ้ไป!! >").ShowButton("close", () => { DoorsControl.Instance.locked[0] = false; //DoorsControl.Instance.locked[1] = false; GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); InventoryManager.Instance.AddItem(0); NotificationText.Instance.AddNotification("ได้รับ คีย์การ์ดสีแดง!!!"); computerFirst = false; UIFloatManager.Instance.ShowUI(1); }); } else { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("craft1")).SetText("Computer1", "สร้างอะไหล่สำหรับยาน \nหรือ \nจะอัพเกรดเพื่อแร่ที่มากขึ้น ").ShowButton("craft", () => { // craft control chip // craft navigator ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("craft1sub")).ShowButton("controlchip", () => { ((uMyGUI_PopupDragdrap)uMyGUI_PopupManager.Instance.ShowPopup("dragdrop")).ShowDragdropPanel("craft_controlchip").ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("navigator", () => { ((uMyGUI_PopupDragdrap)uMyGUI_PopupManager.Instance.ShowPopup("dragdrop")).ShowDragdropPanel("craft_navigator").ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("excavator", () => { uMyGUI_PopupButtons p = ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "Upgrade Excavator\n300 Copper").ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); if (GameManager.Instance.Copper >= 300) { p.ShowButton("yes", () => { GameManager.Instance.RemoveCopper(300); GameManager.Instance.UpgradeExcavator(0); GameManager.Instance.UpgradeExcavator(1); NotificationText.Instance.AddNotification("Remove 300 Copper"); NotificationText.Instance.AddNotification("Excavator Upgraded!!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } } } else if (name.StartsWith("computer2")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("craft1")).SetText("computer2", "สร้างชิ้นส่วนสำหรับทำอะไหล่ \nหรือ \nจะอัพเกรดปืน").ShowButton("craft", () => { // craft control chip // craft navigator ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("craft1sub")).ShowButton("engines", () => { ((uMyGUI_PopupDragdrap)uMyGUI_PopupManager.Instance.ShowPopup("dragdrop")).ShowDragdropPanel("craft_engines").ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("fuel", () => { ((uMyGUI_PopupDragdrap)uMyGUI_PopupManager.Instance.ShowPopup("dragdrop")).ShowDragdropPanel("craft_fuel").ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("weapon", () => { uMyGUI_PopupButtons p = ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "Upgrade Weapon\n100 Silver").ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); if (GameManager.Instance.Silver >= 100) { p.ShowButton("yes", () => { GameManager.Instance.RemoveSilver(100); GameManager.Instance.UpgradeWeapon(); NotificationText.Instance.AddNotification("Remove 100 Silver"); NotificationText.Instance.AddNotification("Weapon Upgraded!!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } } else if (name.StartsWith("computer3")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); if (computer3First) { computer3First = false; UIFloatManager.Instance.ShowUI(4); NotificationText.Instance.AddNotification("ขุดแร่ เพื่อมาคราฟของ"); } uMyGUI_PopupButtons popup = ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("computer3")).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); int c = GameManager.Instance.Copper; int s = GameManager.Instance.Silver; int g = GameManager.Instance.Gold; if (c >= 100 && s >= 20 && g >= 10) { int pc = 100; int ps = 20; int pg = 10; if (!InventoryManager.Instance.HasItem(0)) { popup.ShowButton("redkeycard", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "Copper -" + pc + "\nSilver -" + ps + "\nGold -" + pg).ShowButton("yes", () => { GameManager.Instance.RemoveCopper(pc); GameManager.Instance.RemoveSilver(ps); GameManager.Instance.RemoveGold(pg); InventoryManager.Instance.AddItem(0); NotificationText.Instance.AddNotification("Remove " + pc + "Copper"); NotificationText.Instance.AddNotification("Remove " + ps + "Silver"); NotificationText.Instance.AddNotification("Remove " + pg + "Gold"); NotificationText.Instance.AddNotification("<Red Keycard> Added!!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (!InventoryManager.Instance.HasItem(1)) { popup.ShowButton("greenkeycard", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "Copper -" + pc + "\nSilver -" + ps + "\nGold -" + pg).ShowButton("yes", () => { GameManager.Instance.RemoveCopper(pc); GameManager.Instance.RemoveSilver(ps); GameManager.Instance.RemoveGold(pg); InventoryManager.Instance.AddItem(1); NotificationText.Instance.AddNotification("Remove " + pc + "Copper"); NotificationText.Instance.AddNotification("Remove " + ps + "Silver"); NotificationText.Instance.AddNotification("Remove " + pg + "Gold"); NotificationText.Instance.AddNotification("<Green Keycard> Added!!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } } if (s >= 50 * GameManager.Instance.gun.level) { popup.ShowButton("gun", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "50 Silver").ShowButton("yes", () => { GameManager.Instance.RemoveSilver(50); GameManager.Instance.UpgradeWeapon(); NotificationText.Instance.AddNotification("Remove 50 Silver"); NotificationText.Instance.AddNotification("Weapon Upgraded!!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } // control chip if (g >= 20 && !InventoryManager.Instance.HasItem(6)) { popup.ShowButton("controlchip1", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "CPU ส่วนประกอบสำหรับ control chip\n20 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(20); InventoryManager.Instance.AddItem(6); NotificationText.Instance.AddNotification("Remove 20 Gold"); NotificationText.Instance.AddNotification("CPU added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 30 && !InventoryManager.Instance.HasItem(7)) { popup.ShowButton("controlchip2", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ram ส่วนประกอบสำหรับ control chip\n30 Gold ").ShowButton("yes", () => { GameManager.Instance.RemoveGold(30); InventoryManager.Instance.AddItem(7); NotificationText.Instance.AddNotification("Remove 30 Gold"); NotificationText.Instance.AddNotification("ram added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 40 && !InventoryManager.Instance.HasItem(8)) { popup.ShowButton("controlchip3", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "เมนบอร์ด ส่วนประกอบของ control chip\n40 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(40); InventoryManager.Instance.AddItem(8); NotificationText.Instance.AddNotification("Remove 40 Gold"); NotificationText.Instance.AddNotification("เมนบอร์ด added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } // navigator if (g >= 20 && !InventoryManager.Instance.HasItem(9)) { popup.ShowButton("navigator1", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ต่ำแหน่งดาวเทียมที่ 1 สำหรับ navigator\n20 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(20); InventoryManager.Instance.AddItem(9); NotificationText.Instance.AddNotification("Remove 20 Gold"); NotificationText.Instance.AddNotification("ต่ำแหน่งดาวเทียม 1 added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 30 && !InventoryManager.Instance.HasItem(10)) { popup.ShowButton("navigator2", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ต่ำแหน่งดาวเทียมที่ 2 สำหรับ navigator\n30 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(30); InventoryManager.Instance.AddItem(10); NotificationText.Instance.AddNotification("Remove 30 Gold"); NotificationText.Instance.AddNotification("ต่ำแหน่งดาวเทียม 2 added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 40 && !InventoryManager.Instance.HasItem(11)) { popup.ShowButton("navigator3", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ต่ำแหน่งดาวเทียมที่ 3 สำหรับ navigator\n40 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(40); InventoryManager.Instance.AddItem(11); NotificationText.Instance.AddNotification("Remove 40 Gold"); NotificationText.Instance.AddNotification("ต่ำแหน่งดาวเทียม 3 added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } // engines if (g >= 20 && !InventoryManager.Instance.HasItem(12)) { popup.ShowButton("engine1", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ฟิวส์ คือ ส่วนประกอบในการสร้างเครื่องยนต์\n20 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(20); InventoryManager.Instance.AddItem(12); NotificationText.Instance.AddNotification("Remove 20 Gold"); NotificationText.Instance.AddNotification("ฟิวส์ added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 30 && !InventoryManager.Instance.HasItem(13)) { popup.ShowButton("engine2", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "แบตเตอรี่ คือ ส่วนประกอบในการสร้างเครื่องยนต์ \n30 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(30); InventoryManager.Instance.AddItem(13); NotificationText.Instance.AddNotification("Remove 30 Gold"); NotificationText.Instance.AddNotification("แบตเตอรี่ added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 40 && !InventoryManager.Instance.HasItem(14)) { popup.ShowButton("engine3", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "วาล์ว คือ ส่วนประกอบในการสร้างเครื่องยนต์\n40 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(40); InventoryManager.Instance.AddItem(14); NotificationText.Instance.AddNotification("Remove 40 Gold"); NotificationText.Instance.AddNotification("วาล์ว added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } // fuel if (g >= 20 && !InventoryManager.Instance.HasItem(15)) { popup.ShowButton("fuel1", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ไฮโดรเจน ใช้สำหรับสร้างเชื้อเพลิงยานอวกาศ\n20 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(20); InventoryManager.Instance.AddItem(15); NotificationText.Instance.AddNotification("Remove 20 Gold"); NotificationText.Instance.AddNotification("ไฮโดรเจน added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 30 && !InventoryManager.Instance.HasItem(16)) { popup.ShowButton("fuel2", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ไฮโดรเจน ใช้สำหรับสร้างเชื้อเพลิงยานอวกาศ\n30 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(30); InventoryManager.Instance.AddItem(16); NotificationText.Instance.AddNotification("Remove 30 Gold"); NotificationText.Instance.AddNotification("ไฮโดรเจน added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } if (g >= 40 && !InventoryManager.Instance.HasItem(17)) { popup.ShowButton("fuel3", () => { ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Are you sure?", "ออกซิเจน ใช้สำหรับสร้างเชื้อเพลิงยานอวกาศ\n40 Gold").ShowButton("yes", () => { GameManager.Instance.RemoveGold(40); InventoryManager.Instance.AddItem(17); NotificationText.Instance.AddNotification("Remove 40 Gold"); NotificationText.Instance.AddNotification("ออกซิเจน added!!"); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("no", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }); } } } else if (name.StartsWith("excavator1")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if (!GameManager.Instance.ext[0].startedFlag) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("excavator")).SetText("Excavator01", "Level " + GameManager.Instance.ext[0].level).ShowButton("copper", () => { GameManager.Instance.StartExcavator(0, 200, 0, 0); ExcavatorControl.Instance.ExcavatorOn(0); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); if (excavatorFirst) { EnemyManager.Instance.AddEnemy(0); NotificationText.Instance.AddNotification("เอเลี่ยนปรากฏ <เล็งที่เอเลียนเพื่อชาจอาวุธ>", 10); excavatorFirst = false; UIFloatManager.Instance.HideUI(); } }).ShowButton("silver", () => { GameManager.Instance.StartExcavator(0, 0, 150, 0); ExcavatorControl.Instance.ExcavatorOn(0); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); if (excavatorFirst) { EnemyManager.Instance.AddEnemy(0); NotificationText.Instance.AddNotification("เอเลี่ยนปรากฏ <เล็งที่เอเลียนเพื่อชาตจอาวุธ>", 10); excavatorFirst = false; UIFloatManager.Instance.HideUI(); } }).ShowButton("gold", () => { GameManager.Instance.StartExcavator(0, 0, 0, 100); ExcavatorControl.Instance.ExcavatorOn(0); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); if (excavatorFirst) { EnemyManager.Instance.AddEnemy(0); NotificationText.Instance.AddNotification("เอเลี่ยนปรากฏ <เล็งที่เอเลียนเพื่อชาจอาวุธ>", 10); excavatorFirst = false; UIFloatManager.Instance.HideUI(); } }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } else { if (GameManager.Instance.ext[0].finishedFlag) { Excavator e = GameManager.Instance.ext[0]; e.startedFlag = false; e.finishedFlag = false; GameManager.Instance.AddCopper(e.CopperPerMin); GameManager.Instance.AddSilver(e.SilverPerMin); GameManager.Instance.AddGold(e.GoldPerMin); //GameManager.Instance.RestartExcavator(0); if (e.CopperPerMin > 0) { NotificationText.Instance.AddNotification("Copper + " + e.CopperPerMin); } if (e.SilverPerMin > 0) { NotificationText.Instance.AddNotification("Silver + " + e.SilverPerMin); } if (e.GoldPerMin > 0) { NotificationText.Instance.AddNotification("Gold + " + e.GoldPerMin); } e.progressWheel.value = 0; } } } } else if (name.StartsWith("excavator2")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if (!GameManager.Instance.ext[1].startedFlag) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("excavator")).SetText("Excavator02", "Level " + GameManager.Instance.ext[1].level).ShowButton("copper", () => { GameManager.Instance.StartExcavator(1, 200, 0, 0); ExcavatorControl.Instance.ExcavatorOn(1); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("silver", () => { GameManager.Instance.StartExcavator(1, 0, 150, 0); ExcavatorControl.Instance.ExcavatorOn(1); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("gold", () => { GameManager.Instance.StartExcavator(1, 0, 0, 100); ExcavatorControl.Instance.ExcavatorOn(1); GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } else { if (GameManager.Instance.ext[1].finishedFlag) { Excavator e = GameManager.Instance.ext[1]; e.startedFlag = false; e.finishedFlag = false; GameManager.Instance.AddCopper(e.CopperPerMin); GameManager.Instance.AddSilver(e.SilverPerMin); GameManager.Instance.AddGold(e.GoldPerMin); //GameManager.Instance.RestartExcavator(1); if (e.CopperPerMin > 0) { NotificationText.Instance.AddNotification("Copper + " + e.CopperPerMin); } if (e.SilverPerMin > 0) { NotificationText.Instance.AddNotification("Silver + " + e.SilverPerMin); } if (e.GoldPerMin > 0) { NotificationText.Instance.AddNotification("Gold + " + e.GoldPerMin); } e.progressWheel.value = 0; } } } } else if (name.StartsWith("excavator3")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("popup")).SetText("Excavator03<Broken>", "<Broken...>").ShowButton("ok", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } } else if (name.StartsWith("rocket")) { HandPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { GameManager.Instance.FreezPlayer(true); GameManager.Instance.Pause(); if (rocketFirst) { rocketFirst = false; UIFloatManager.Instance.ShowUI(3); NotificationText.Instance.AddNotification("หาอุปกรณ์ในการซ่อมแซมเพิ่ม"); } ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup("rocket")).SetText("Rocket", "<ยานพัง มีอะไหล่ บางส่วนหายไป>").ShowButton("end", () => { if (InventoryManager.Instance.End) { NotificationText.Instance.AddNotification("ขอบคุณครับ"); StartCoroutine(EndGame()); } else { NotificationText.Instance.AddNotification("จะต้องซ่อมยานก่อน"); } GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }).ShowButton("fix", () => { ((uMyGUI_PopupDragdrap)uMyGUI_PopupManager.Instance.ShowPopup("dragdrop")).ShowDragdropPanel("rocket").ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); }).ShowButton("close", () => { GameManager.Instance.FreezPlayer(false); GameManager.Instance.Unpause(); }); } } else if (name.StartsWith("poster1")) { GameManager.Instance.AddCopper(60); hit.collider.gameObject.GetComponent <BoxCollider>().enabled = false; NotificationText.Instance.AddNotification("ได้รับ ทองแดง 60"); } else if (name.StartsWith("poster2")) { GameManager.Instance.AddSilver(50); hit.collider.gameObject.GetComponent <BoxCollider>().enabled = false; NotificationText.Instance.AddNotification("ได้รับ แร่เงิน 50"); } else if (name.StartsWith("poster3")) { GameManager.Instance.AddGold(20); hit.collider.gameObject.GetComponent <BoxCollider>().enabled = false; NotificationText.Instance.AddNotification("ได้รับ แร่ทอง 20"); } else { hideAllUI(); } } else { hideAllUI(); } }