/* DESC :> * 룰렛 멈춘 금액 확인 후 금액 증가 */ public void StopRulet() { float degree = ruletPan.transform.localEulerAngles.z; if (degree < 0) { degree = (degree + 360) % 360; } int rate = 0; int curRulet = (int)(degree / 72); string parseText = ruletText[curRulet].text; parseText = parseText.Replace("X", ""); rate = int.Parse(parseText); int increaseGold = rate * batingGold; GlobalData.getInstance.curGold += (increaseGold - batingGold); PlayerPrefs.SetInt("Gold", GlobalData.getInstance.curGold); //PlayerPrefs.Save(); PopupManager.getInstance.Show <DayEndPopup>(); popupRateText.text = string.Format("x {0}", rate); popupGoldText.text = string.Format("{0}냥", GoldConvert.GetGoldFormat(increaseGold)); int ruletCtn = PlayerPrefs.GetInt("RuletCount", 0); PlayerPrefs.SetInt("RuletCount", ruletCtn + 1); }
public void TutorialInit() { gameCtrl = FindObjectOfType <InGameCookingController>(); canvasUI = GameObject.Find("Canvas (UI)").FindChild("Panel"); UIButtonManager btnMgr = UIButtonManager.getInstance; btnMgr.SetButtonMsg(GameObject.Find("MeatButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.MEAT]); }); btnMgr.SetButtonMsg(GameObject.Find("SauceButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.SAUCE]); }); GameObject selectCookUIObj = GameObjectHelper.Find("SelectMeatUI"); GameObject selectSauceUIObj = GameObjectHelper.Find("SelectSauceUI"); subUIList.Clear(); subUIList.Add(selectCookUIObj.GetComponent <SelectMeatUI>()); subUIList.Add(selectSauceUIObj.GetComponent <SelectSauceUI>()); subUIList[0].Init(IngredientManager.getInstance.GetIngredients(EIngredientType.Galbi), OnSetFoodMakeItem); subUIList[1].Init(IngredientManager.getInstance.GetIngredients(i => i.type == EIngredientType.Powder || i.type == EIngredientType.Sauce), OnSetFoodMakeItem); timerLabel = GameObject.Find("Timer").FindChild("Label (Timer)").GetComponent <Text>(); timerTypeLabel = GameObject.Find("Timer").FindChild("Label (Timer Type)").GetComponent <Text>(); timerLabel.text = string.Format("{0:00}:{1:00}", 8, 0); timerTypeLabel.text = "AM"; moneyLabel = GameObject.Find("Label (Money)").GetComponent <Text>(); moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(GlobalData.getInstance.curGold)); }
/* DESC :> * 배팅 금액 변경 */ public void IncreaseBating(int value) { batingGold += value; if (batingGold < 100 || batingGold > 900) { batingGold -= value; } textGold.text = string.Format("{0}", GoldConvert.GetGoldFormat(batingGold)); }
public void OnUpdateMoneyInfo() { int curGold = GlobalData.getInstance.curGold; #if DEBUG_LOG Debug.Log("CUR GOLD : " + curGold); #endif moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(curGold)); PlayerPrefs.SetInt("GOLD", curGold); }
public void HappyNyang() { int sndIdx = UnityEngine.Random.Range((int)FX_SOUND_TYPE.HAPPY1, (int)FX_SOUND_TYPE.HAPPY2); Client.AudioManager.Play(sndIdx); SetState(ENyangState.happy); nyangCtrl.arrivedManager.Arrived(this); increaseMoneyText.text = string.Format("+{0}", GoldConvert.GetGoldFormat((int)(300 * GlobalData.getInstance.goldIncreaseRate))); increaseMoney.SetActive(true); }
private void Awake() { temperatureGaugeImg = GameObject.Find("Image (TemperatureGauge)").GetComponent <RectTransform> (); // DESC :> Image Size : 0 으로 초기화 temperatureGaugeImg.sizeDelta = new Vector2(temperatureGaugeImg.sizeDelta.x, 0.0f); resultBox = GameObjectHelper.Find("ResultBox"); resultBoxImg = resultBox.FindChild("Image (Result Box)").GetComponent <Image> (); resultLabel = resultBox.FindChild("Label (Result)").GetComponent <Text> (); UIButtonManager btnMgr = UIButtonManager.getInstance; GameObject pushBtnObj = GameObject.Find("PushButton"); btnMgr.SetButtonMsg(pushBtnObj, () => { // DESC :> 레디가 다 끝났는지 GameObject readyBoxObj = GameObject.Find("ReadyBox"); if (readyBoxObj) { return; } Image btnImg = pushBtnObj.FindChild("Image (Button)").GetComponent <Image>(); btnImg.sprite = (Sprite)Resources.Load("Texture/MiniGame/btn_push_2", typeof(Sprite)); // DESc :> 썬텐 종료 isEnd = true; }); timerLabel = GameObject.Find("Timer").FindChild("Label (Timer)").GetComponent <Text>(); int h = 15; int m = 0; bool isPM = (h / 12) == 1; timerLabel.text = string.Format("{0:00}:{1:00}{2}", isPM ? (h % 12) == 0 ? 12 : (h % 12) : (h % 12), m % 60, isPM ? "PM" : "AM"); moneyLabel = GameObject.Find("Label (Money)").GetComponent <Text>(); moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(GlobalData.getInstance.curGold)); characterImage = GameObject.Find("Image (Character)").GetComponent <Image>(); faceImage = GameObject.Find("Image (Face)").GetComponent <Image>(); readyText = GameObject.Find("Label (Ready)").GetComponent <Text>(); readyBoxObj = GameObject.Find("ReadyBox"); StartCoroutine(FrameUpdate()); }
public void InitUI() { gameCtrl = FindObjectOfType <InGameCookingController>(); canvasUI = GameObject.Find("Canvas (UI)").FindChild("Panel"); InitSubUIList(); DecoManager.getInstance.Init(); DecoManager.getInstance.ChangeDecoImage(0, "main_roof"); IngredientStorePopup = GameObjectHelper.Find("IngredientStorePopup").GetComponent <IngredientStorePopup> (); decoStorePopup = GameObjectHelper.Find("DecoStorePopup").GetComponent <DecoStorePopup>(); UIButtonManager btnMgr = UIButtonManager.getInstance; btnMgr.SetButtonMsg(GameObject.Find("MatShopButton"), OnMatShopButtonClick); btnMgr.SetButtonMsg(GameObject.Find("HouseShopButton"), OnHouseShopButtonClick); btnMgr.SetButtonMsg(GameObject.Find("BuffButton"), OnBuffButtonClick); btnMgr.SetButtonMsg(GameObject.Find("TrashButton"), OnTrashButtonClick); btnMgr.SetButtonMsg(GameObject.Find("OptionButton"), OnOptionButtonClick); btnMgr.SetButtonMsg(GameObject.Find("CatListButton"), OnCatListButtonClick); btnMgr.SetButtonMsg(GameObject.Find("MeatButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.MEAT]); }); btnMgr.SetButtonMsg(GameObject.Find("SauceButton"), () => { OnShowSelectSubUI(subUIList[(int)SUB_UI_TYPE.SAUCE]); }); timerLabel = GameObject.Find("Timer").FindChild("Label (Timer)").GetComponent <Text>(); timerTypeLabel = GameObject.Find("Timer").FindChild("Label (Timer Type)").GetComponent <Text>(); moneyLabel = GameObject.Find("Label (Money)").GetComponent <Text>(); moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(GlobalData.getInstance.curGold)); dayLabel = GameObject.Find("Label(Day)").GetComponent <Text>(); dayLabel.text = GlobalData.getInstance.curDay.ToString(); if (GlobalData.getInstance.isAdsBuff) { GameObjectHelper.Find("Bone").FindChild("Image").GetComponent <Image>().sprite = ResourcesManager.getInstance.CreateSprite("main_bone_buff", new Vector2(0.5f, 0.5f), 1.0f); GameObjectHelper.Find("BuffButton").FindChild("Image").GetComponent <Image>().sprite = ResourcesManager.getInstance.CreateSprite("main_btn_buff_push", new Vector2(0.5f, 0), 1.0f); GameObjectHelper.Find("BuffNyang").FindChild("Image").SetActive(true); } }
private void Awake() { List <int> Rate = new List <int> { 0, 1, 2, 10, 100 }; UIButtonManager btnMgr = UIButtonManager.getInstance; ruletPan = GameObject.Find("RuletPanels"); textGold = GameObject.Find("RateBoard").FindChild("Label (Rate)").GetComponent <Text>(); textGold.text = string.Format("{0}", GoldConvert.GetGoldFormat(batingGold)); int maxLen = Rate.Count; timerLabel = GameObject.Find("Timer").FindChild("Label (Timer)").GetComponent <Text>(); int h = 20; int m = 0; bool isPM = (h / 12) == 1; timerLabel.text = string.Format("{0:00}:{1:00}{2}", isPM ? (h % 12) == 0 ? 12 : (h % 12) : (h % 12), m % 60, isPM ? "PM" : "AM"); moneyLabel = GameObject.Find("Label (Money)").GetComponent <Text>(); moneyLabel.text = string.Format("{0}", GoldConvert.GetGoldFormat(GlobalData.getInstance.curGold)); while (Rate.Count > 0) { Text label = ruletPan.FindChild(string.Format("Image (Rulet{0})", maxLen - Rate.Count)).FindChild("Label (Rate)").GetComponent <Text>(); int rand = Random.Range(0, Rate.Count); label.text = string.Format("X{0}", Rate[rand]); Rate.RemoveAt(rand); } GameObject pushBtnObj = GameObject.Find("PushButton"); btnMgr.SetButtonMsg(pushBtnObj, () => { if (isEnd) { return; } isEnd = true; GameObject readyBoxObj = GameObject.Find("ReadyBox"); if (readyBoxObj) { return; } Image btnImg = pushBtnObj.FindChild("Image (Button)").GetComponent <Image>(); btnImg.sprite = (Sprite)Resources.Load("Texture/MiniGame/btn_push_2", typeof(Sprite)); StartCoroutine(UpdateRulet()); }); GameObject upBtnObj = GameObject.Find("UpButton"); btnMgr.SetButtonMsg(upBtnObj, () => { if (!isEnd) { IncreaseBating(10); } }); GameObject downBtnObj = GameObject.Find("DownButton"); btnMgr.SetButtonMsg(downBtnObj, () => { if (!isEnd) { IncreaseBating(-10); } }); GameObject popupInfo = GameObjectHelper.Find("DayEndPopup").FindChild("Info"); popupRateText = popupInfo.FindChild("Label (Rate)").GetComponent <Text>(); popupGoldText = popupInfo.FindChild("Label (Gold)").GetComponent <Text>(); ruletText = new Text[ruletSize]; ruletText[0] = ruletPan.FindChild("Image (Rulet0)").FindChild("Label (Rate)").GetComponent <Text>(); ruletText[1] = ruletPan.FindChild("Image (Rulet4)").FindChild("Label (Rate)").GetComponent <Text>(); ruletText[2] = ruletPan.FindChild("Image (Rulet3)").FindChild("Label (Rate)").GetComponent <Text>(); ruletText[3] = ruletPan.FindChild("Image (Rulet2)").FindChild("Label (Rate)").GetComponent <Text>(); ruletText[4] = ruletPan.FindChild("Image (Rulet1)").FindChild("Label (Rate)").GetComponent <Text>(); }