void Start() { goldTextObject = GameObject.Find("CurrentGold"); goldText = goldTextObject.GetComponent <Text>(); xpTextObject = GameObject.Find("CurrentXp"); xpText = xpTextObject.GetComponent <Text>(); xpPercentageTextObject = GameObject.Find("XpBarHolder"); xpPercentageText = xpPercentageTextObject.GetComponent <Text>(); lvlTextObject = GameObject.Find("LvlText"); lvlText = lvlTextObject.GetComponent <Text>(); lvlText.text = GameControl.control.lvl.ToString(); xp = GameControl.control.xp; gold = GameControl.control.gold; goldText.text = GameControl.control.gold.ToString(); xpText.text = GameControl.control.xp.ToString(); float tempPercentage = experienceSystem.GetXpPercent() * 100; xpPercentageText.text = Math.Round((tempPercentage), 1) + "%"; canvasObj = GameObject.FindGameObjectWithTag("Canvas"); // float tmpLvl = GameControl.control.lvl; // double p = Mathf.Pow(tmpLvl, 0.5f); // basicAtkDmg += (int) p * 3; // aoeDmg += (int) p; // shootingDmg += (int) p; // healingAmount += (int) p; basicAtkDmg += GameControl.control.lvl; aoeDmg += GameControl.control.lvl; shootingDmg += GameControl.control.lvl; healingAmount += GameControl.control.lvl; stunPoint.GetComponent <StunCollider>().enabled = false; stunPoint.GetComponent <BoxCollider2D>().enabled = false; moving = true; cam = FindObjectOfType <Camera>(); if (FindObjectOfType <Joystick>() != null) { joystick = GameObject.Find("WalkingJoystick").GetComponent <Joystick>(); } }
private void UpdateXpBar() { transform.Find("BarXp").localScale = new Vector3(xpSystem.GetXpPercent(), 1); }