Exemplo n.º 1
0
        public void SpellUpdate(SpellCasting spellCasting)
        {
            bool tmp = Input.GetAxisRaw("Spell 1") > 0f;

            if (tmp != fireAxis[0])
            {
                if (tmp)
                {
                    spellCasting.SpellPressed(0);
                }
                else
                {
                    spellCasting.SpellReleased(0);
                }
            }
            fireAxis[0] = tmp;

            tmp = Input.GetAxisRaw("Spell 2") < 0f;
            if (tmp != fireAxis[1])
            {
                if (tmp)
                {
                    spellCasting.SpellPressed(1);
                }
                else
                {
                    spellCasting.SpellReleased(1);
                }
            }
            fireAxis[1] = tmp;

            if (Input.GetButtonDown("Spell 3"))
            {
                spellCasting.SpellPressed(2);
            }
            else if (Input.GetButtonUp("Spell 3"))
            {
                spellCasting.SpellReleased(2);
            }

            if (Input.GetButtonDown("Spell 4"))
            {
                spellCasting.SpellPressed(3);
            }
            else if (Input.GetButtonUp("Spell 4"))
            {
                spellCasting.SpellReleased(3);
            }
        }
Exemplo n.º 2
0
        public void SpellUpdate(ref SpellCasting spellCasting)
        {
            if (Input.GetButtonDown("Spell 1"))
            {
                spellCasting.SpellPressed(0);
            }
            else if (Input.GetButtonUp("Spell 1"))
            {
                spellCasting.SpellReleased(0);
            }

            if (Input.GetButtonDown("Spell 2"))
            {
                spellCasting.SpellPressed(1);
            }
            else if (Input.GetButtonUp("Spell 2"))
            {
                spellCasting.SpellReleased(1);
            }

            if (Input.GetButtonDown("Spell 3"))
            {
                spellCasting.SpellPressed(2);
            }
            else if (Input.GetButtonUp("Spell 3"))
            {
                spellCasting.SpellReleased(2);
            }

            if (Input.GetButtonDown("Spell 4"))
            {
                spellCasting.SpellPressed(3);
            }
            else if (Input.GetButtonUp("Spell 4"))
            {
                spellCasting.SpellReleased(3);
            }

            if (spellCasting.casting)
            {
                spellCasting.CastUpdate(rayCast.BoardRayCast());
            }
        }