Ejemplo n.º 1
0
    void shootBallUp()
    {
        GameObject          light_ball_temp = (GameObject)Instantiate(light_ball, firePoint.position, firePoint.rotation);
        LightBallController controller      = light_ball_temp.GetComponent <LightBallController> ();

        controller.shoot_speed_horizontal = 0f;
        balls.Add(light_ball_temp);
        health.decrementLifeOnShootBall();
    }
Ejemplo n.º 2
0
    void shootBallHorizontal()
    {
        GameObject          light_ball_temp = (GameObject)Instantiate(light_ball, firePoint.position, firePoint.rotation);
        LightBallController controller      = light_ball_temp.GetComponent <LightBallController> ();

        if (transform.localScale.x < 0)
        {
            controller.shoot_speed_horizontal *= -1;
        }
        controller.shoot_speed_vertical = 0f;
        balls.Add(light_ball_temp);
        health.decrementLifeOnShootBall();
    }