コード例 #1
0
        /// <param name="random">IMPORTANT: This may be part of the game state</param>
        /// <param name="cueStates">IMPORTANT: This may be part of the game state</param>
        /// <param name="playLocally">True if this sound should be played, false if the sound is for a remote player (not for us). Allows for local-only UI sounds.</param>
        public void PlayCue(IAudioDefinitions definitions, Cue cue, Position?worldPosition, FadePitchPan fpp, PlayCueParameters parameters, bool playsLocally)
        {
            if (parameters.soundIndex == PlayCueParameters.MISSING_CUE)
            {
                if (!doingPrediction) // <- poor man's "first time simulated" (Missing music doesn't get rollback-aware sound handling)
                {
                    MissingAudio.TriedToPlayMissingCue(fpp);
                }
                return;
            }

            PlayCueSkipMissingCheck(definitions, cue, worldPosition, fpp, parameters, playsLocally);
        }
コード例 #2
0
        public static void PlayCue(IAudioDefinitions definitions, Cue cue, PlayCueParameters parameters, FadePitchPan fpp, bool loop = false)
        {
            if (parameters.soundIndex == PlayCueParameters.MISSING_CUE)
            {
                MissingAudio.TriedToPlayMissingCue(fpp);
                return;
            }

            if (parameters.soundIndex < 0)
            {
                return;
            }

            PlayCueSkipMissingCheck(definitions, cue, parameters, fpp, loop);
        }