Пример #1
0
        IEnumerator CastAtTime(float time)
        {
            while (true)
            {
                yield return(new WaitForSeconds(time));

                spellCaster.CastAbility(ability);
            }
        }
Пример #2
0
        void Update()
        {
            if (Input.GetKeyDown("space"))
            {
                spellCaster.CastAbility(hommingAbility);
            }

            Vector3 velocity = new Vector3
            {
                x = joystick.JoystickAxis.x,
                y = 0,
                z = joystick.JoystickAxis.y
            };

            spellCaster.velocity = velocity;
            if (velocity.magnitude > 0)
            {
                spellCaster.CastAbility(aimedAbility);
            }
        }