コード例 #1
0
    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);
        }
    }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 void FireBall()
 {
     BassCannon.FireBall();
 }