Exemple #1
0
    public override void ability2Down()
    {
        if(abilTimer2 < 0 && globalCD < 0){

            abilTimer2 = abilCD2;
            globalCD = GLOBAL_CD;

            GameObject Rocket = (GameObject) GameObject.Instantiate(Resources.Load ("Prefabs/Rocket"));
            Projectile script = Rocket.GetComponent<Projectile>();
            int dmg = 10;
            //Angle, spawn position, parent, ability num, damage, speed, Max_Distance
            script.setDirectionAndOrigin(rightStickAngle, transform.position, gameObject, 2, 0, 14, 16);
            tryToHome(Rocket, script);

            detonator = Rocket.GetComponent<Detonator>();
            detonator.init (dmg, 2, gameObject);

            abilPressed2 = true;

        }
    }