// Use this for initialization void Awake() { Instance = this; shootFireBall = GetComponentInChildren <ShootFireBall> (); playerHealth = GetComponent <PlayerHealth> (); playerMana = GetComponent <PlayerMana> (); playerMovement = GetComponent <PlayerMovement> (); orbControl = GetComponentInChildren <OrbControl> (); skill1Text = Skill1.GetComponentsInChildren <Text> (); skill2Text = Skill2.GetComponentsInChildren <Text> (); skill3Text = Skill3.GetComponentsInChildren <Text> (); skill1Image = Skill1.GetComponentInChildren <Image> (); skill2Image = Skill2.GetComponentInChildren <Image> (); skill3Image = Skill3.GetComponentInChildren <Image> (); skill1Button = Skill1.GetComponent <Button> (); skill2Button = Skill2.GetComponent <Button> (); skill3Button = Skill3.GetComponent <Button> (); skillValues.Add(new KeyValuePair <string, int> ("Explosion Size", 1)); skillValues.Add(new KeyValuePair <string, int> ("FireBolt Damage", 1)); skillValues.Add(new KeyValuePair <string, int> ("FireBall", 0)); skillValues.Add(new KeyValuePair <string, int> ("Health Up", 1)); skillValues.Add(new KeyValuePair <string, int> ("Mana Up", 1)); skillValues.Add(new KeyValuePair <string, int> ("Mana Recovery Rate", 1)); skillValues.Add(new KeyValuePair <string, int> ("Walking Speed", 1)); skillText = new string[] { "Radius +0.5 \r\nMana Cost +0.1", "SpellDamage +10 \r\nManaCost +0.2", "New Skill: FireBall\r\nPress 1 to use", "Max Health +20", "Max Mana +20", "Recovery Rate +0.2", "Speed +0.2" }; eventAdded = false; currentLevel = 1; }
bool damaged; // True when the player gets damaged. void Awake() { Instance = this; // Setting up the references. anim = GetComponent <Animator> (); playerAudio = GetComponents <AudioSource> (); playermovement = GetComponent <PlayerMovement> (); shootFireBolt = GetComponentInChildren <ShootFireBolt> (); orbControl = GetComponentInChildren <OrbControl> (); gameOverAnim = gameOverCanvas.GetComponent <Animator> (); // Set the initial health of the player. currentHealth = startingHealth; }
void Start() { Instance = this; vertical = transform.eulerAngles.x; }