void Start() { //Load the AudioSource attached to the Conductor GameObject musicSource = GetComponent <AudioSource>(); //Calculate the number of seconds in each beat secPerBeat = 60f / songBpm; //Record the time when the music starts dspSongTime = (float)AudioSettings.dspTime; //Start the music musicSource.Play(); BassCannon.FireBall(); //Testing out a new way of visualizing the timing better for level creators if (timerData != null) { SetWinningBeats(timerData.songTimer); } }
void Update() { if (UnityEngine.Input.GetKey(KeyCode.A)) { Aiming.RotateYaw(-1); } else if (UnityEngine.Input.GetKey(KeyCode.D)) { Aiming.RotateYaw(1); } if (UnityEngine.Input.GetKey(KeyCode.W)) { Aiming.RotatePitch(-1); } else if (UnityEngine.Input.GetKey(KeyCode.S)) { Aiming.RotatePitch(1); } if (UnityEngine.Input.GetKeyDown(KeyCode.Space)) { Cannon.FireBall(DefaultForce); } }
void FireBall() { BassCannon.FireBall(); }