Ejemplo n.º 1
0
 void KickMissFeedback()
 {
     if (sample.Play())
     {
         camShake.ShakeCamera();
     }
 }
 void KickMissFeedback()
 {
     if (missSoundSample.Play())      // If we try to play this again before the sample has ended we'll get rejected. Should also reject the whole event.
     {
         ChartEditor.Instance.gameplayEvents.explicitMissEvent.Fire();
     }
 }
    // Update is called once per frame
    public void Update()
    {
        // Offset by audio calibration
        Vector3 pos = initLocalPos;

        pos.y += TickFunctions.TimeToWorldYPosition(GameSettings.audioCalibrationMS / 1000.0f * GameSettings.gameSpeed);
        transform.localPosition = pos;

        uint currentTickPos = editor.currentSong.WorldYPositionToTick(transform.position.y);

        if (Globals.applicationMode == Globals.ApplicationMode.Playing)
        {
            if (currentTickPos >= nextClapPos)
            {
                if (GameSettings.metronomeActive)
                {
                    sampleStream.volume = GameSettings.sfxVolume * GameSettings.vol_master;
                    sampleStream.pan    = GameSettings.audio_pan;
                    sampleStream.Play();
                }
            }
        }

        nextClapPos = CalculateNextBeatTickPosition(currentTickPos);
    }
    public void Clap(float worldYPos)
    {
        if (Globals.applicationMode != Globals.ApplicationMode.Playing)
        {
            lastClapPos = -1;
        }

        if (worldYPos > lastClapPos && worldYPos >= startYPoint)
        {
            sample.volume = GameSettings.sfxVolume * GameSettings.vol_master;
            sample.pan    = GameSettings.audio_pan;
            sample.Play();
        }
        lastClapPos = worldYPos;
    }
Ejemplo n.º 5
0
    public override void SystemUpdate()
    {
        ChartEditor editor      = ChartEditor.Instance;
        Song        currentSong = editor.currentSong;

        float currentAudioTime = editor.services.sfxAudioTime;
        uint  currentTickPos   = editor.currentSong.TimeToTick(currentAudioTime, editor.currentSong.resolution);

        if (currentTickPos >= nextClapPos)
        {
            if (Globals.gameSettings.metronomeActive)
            {
                sampleStream.volume = Globals.gameSettings.sfxVolume * Globals.gameSettings.vol_master;
                sampleStream.pan    = Globals.gameSettings.audio_pan;
                sampleStream.Play();
            }

            nextClapPos = CalculateNextBeatTickPosition(currentTickPos);
        }
    }