示例#1
0
        // 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);
        }
示例#2
0
        void LaserAction()
        {
            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.Laser laser = (Spells.Laser) this.player.GetSpell("Laser");
            laser.SetLocation(target);
            laser.Cast();
        }