void Awake() { instance = this; // initialize BENumber class and set ui element Exp = new BENumber(BENumber.IncType.VALUE, 0, 100000000, 0); Exp.AddUIImage(BEUtil.GetObject("PanelOverlay/LabelExp/Fill").GetComponent <Image>()); Gold = new BENumber(BENumber.IncType.VALUE, 0, 200000, 10000); // initial gold count is 1000 Gold.AddUIText(BEUtil.GetObject("PanelOverlay/LabelGold/Text").GetComponent <Text>()); Gold.AddUIImage(BEUtil.GetObject("PanelOverlay/LabelGold/Fill").GetComponent <Image>()); Elixir = new BENumber(BENumber.IncType.VALUE, 0, 300000, 10000); // initial elixir count is 1000 Elixir.AddUIText(BEUtil.GetObject("PanelOverlay/LabelElixir/Text").GetComponent <Text>()); Elixir.AddUIImage(BEUtil.GetObject("PanelOverlay/LabelElixir/Fill").GetComponent <Image>()); Gem = new BENumber(BENumber.IncType.VALUE, 0, 100000000, 1000); // initial gem count is 100 0 Gem.AddUIText(BEUtil.GetObject("PanelOverlay/LabelGem/Text").GetComponent <Text>()); HouseInfo = BEUtil.GetObject("PanelOverlay/LabelHouse/Text").GetComponent <Text>(); Shield = new BENumber(BENumber.IncType.TIME, 0, 100000000, 0); Shield.AddUIText(BEUtil.GetObject("PanelOverlay/LabelShield/Text").GetComponent <Text>()); // For camera fade animation, set cameras initial positions goCameraRoot.transform.position = new Vector3(-5.5f, 0, -5); goCamera.transform.localPosition = new Vector3(0, 0, -128.0f); InFade = true; // 游戏开始时放大 FadeAge = 0.0f; }
void Start() { // set range of numbers and type BESetting.Gold.AddUIText(textGold); Win = new BENumber(BENumber.IncType.VALUE, "#,##0.00", 0, 10000000000, 0); Win.AddUIText(textTotalWin); //set saved user gold count to slotgame Slot.Gold = (float)BESetting.Gold.Target(); //set win value to zero Win.ChangeTo(0); UpdateUI(); //double button show only user win btnDouble.gameObject.SetActive(false); textInfo.text = ""; }