public override void Collect(Classes.Player player) { // Give player the ability to cast Blink. Spells.Blink blink = (Spells.Blink)player.GetSpell("Blink"); player.ReceiveBuff(blink); this.GetUI(player).SetSpellText("Blink", 5); GameObject.Instantiate(Resources.Load("Effects\\BlueEffect"), player.transform.position, Quaternion.identity); }
// Use this for initialization void Start() { this.healthSlider.value = this.healthSlider.maxValue; this.player = this.playerObj.GetComponent <Classes.Player>(); this.blink = (Spells.Blink) this.player.GetSpell("Blink"); this.laser = (Spells.Laser) this.player.GetSpell("Laser"); this.invuln = (Spells.Invulnerability) this.player.GetSpell("Invulnerability"); this.shield = (Spells.Health) this.player.GetSpell("Health"); this.gravity = (Spells.InvertGravity) this.player.GetSpell("InvertGravity"); this.ToggleSpellUI(false); }
void BlinkAction() { Vector3 target = Input.mousePosition; target.z = -Camera.main.transform.position.z + this.transform.position.z; target = Camera.main.ScreenToWorldPoint(target); target.z = 0.2f; Spells.Blink blink = (Spells.Blink) this.player.GetSpell("Blink"); blink.SetLocation(target); blink.Cast(); }