public void PickUpSpeedBuff() { //reset speedbuff deplete timer. speedBuffTimer = speedBuffTime; //probably around 15 seconds //Set SpeedBuffActive to true speedBuffActive = true; speedBuffCopy = Instantiate(damageNum, numSpawnPos.transform.position, Quaternion.identity) as GameObject; speedBuffCopy.transform.SetParent(this.transform); buffText = speedBuffCopy.GetComponentInChildren <Text>(); buffText.color = speedBuffColor; textThrowScript = speedBuffCopy.GetComponent <ThrowNums>(); textThrowScript.numbers = false; buffText.text = "SPEED BOOST!"; speedboostRing.GetComponent <SpriteRenderer>().color = speedBuffColor; //Animation flash speedBoost = true; }
public void PickUpOvercharge() { overchargeTimer = overchargeTime; overchargeActive = true; overChargeBuffCopy = Instantiate(damageNum, numSpawnPos.transform.position, Quaternion.identity) as GameObject; overChargeBuffCopy.transform.SetParent(this.transform); buffText = overChargeBuffCopy.GetComponentInChildren <Text>(); buffText.color = overchargeColor; textThrowScript = overChargeBuffCopy.GetComponent <ThrowNums>(); textThrowScript.numbers = false; buffText.text = "OVERCHARGED!"; overchargeRing.GetComponent <SpriteRenderer>().color = overchargeColor; //DisplayShieldsUI DisplayOvercharge(); //Shields animation overchargeHit = true; }
/* * old one VV * void HealNumbers(int amtHeal) * { * healNumCopy = Instantiate(damageNum, numSpawnPos.transform.position, Quaternion.identity) as GameObject; * healNumCopy.transform.SetParent(this.transform); * healNumText = healNumCopy.GetComponentInChildren<Text>(); * healNumText.color = healColor; * * string i = amtHeal.ToString(); * healNumText.text = i; * * healNumScript = healNumCopy.GetComponent<ThrowNums>(); * healNumScript.numbers = true; * healNumScript.SetSign(true, amtHeal); * } */ void HealNumbers(int amtHeal) { if (healNumCopy != null) { //Heal Num is already out healNumScript.IncreaseNumBy(amtHeal); } else { //Heal Num is not out healNumCopy = Instantiate(damageNum, numSpawnPos.transform.position, Quaternion.identity) as GameObject; healNumCopy.transform.SetParent(this.transform); healNumText = healNumCopy.GetComponentInChildren <Text>(); healNumScript = healNumCopy.GetComponent <ThrowNums>(); healNumText.color = healColor; healNumScript.myColor = healColor; healNumScript.IncreaseNumBy(amtHeal); healNumScript.numbers = true; healNumScript.SetSign(true, amtHeal); } }