void Start() { message = SendStop(); gameOn = FindObjectOfType <Spawner>().gameOn; backtrackNotes = RandomEnumSetter.MakeSongFromText(backtrackChannel); currentNote = 0; speed = FindObjectOfType <Spawner>().speed; delay = FindObjectOfType <Spawner>().delay; }
void Start() { btn.onClick.AddListener(StartGame); timeBetweenSpawnsInSeconds = 60f / beatsPerMinute; speed = spaceBetweenNotes * 0.64f / timeBetweenSpawnsInSeconds; screenHalfSizeInWorldUnits = new Vector2(Camera.main.aspect * Camera.main.orthographicSize, Camera.main.orthographicSize); songArray = RandomEnumSetter.MakeSongFromText(song); currentNote = 0; float dist = screenHalfSizeInWorldUnits.x - FindObjectOfType <Player>().transform.position.x; delay = dist / speed; }