Ejemplo n.º 1
0
        /// <summary>
        /// Il va lancé une boule de feu en ligne droite vers la direction du regard de la Pièce
        /// </summary>
        /// <param name="dirx"></param>
        /// <param name="diry"></param>
        public override void Action(int dirx, int diry)
        {
            FireballSoundManagerScript.soundInstance.PlaySound();
            Vector3  position = parent.transform.position;
            Fireball fireball = Instantiate(attack, position, Quaternion.identity).GetComponent <Fireball>();

            fireball.parent             = parent;
            fireball.transform.position = new Vector3(position.x + dirx * 1.1f, position.y + diry * 1.1f, position.z);
            fireball.dirY  = diry;
            fireball.dirX  = dirx;
            fireball.Speed = 7f;
            fireball.LoadSprite();
        }
Ejemplo n.º 2
0
    public override void Action(int dirx, int diry)
    {
        Vector3 position = parent.transform.position;

        switch (typeAttack)
        {
        case 1:
            Fireball fireball = Instantiate(attack, position, Quaternion.identity).GetComponent <Fireball>();
            fireball.transform.position = new Vector3(position.x + dirx * 1.1f, position.y + diry * 1.1f, position.z);
            fireball.dirY  = diry;
            fireball.dirX  = dirx;
            fireball.Speed = 5;
            fireball.LoadSprite();
            //Debug.Break();
            break;
        }
    }