// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); PMScript = (Player_Movement)player.GetComponent(typeof(Player_Movement)); speed = PMScript.GetVSpeed(); }
public void FireBullet() { if (canFireIn > 0) { return; } var direction = Vector2.up; var bullet = (Bullet)Instantiate(Bullet, transform.position, transform.rotation); bullet.Initialize(gameObject, direction, PMScript.GetVSpeed()); }