Terraria.ModLoader.SoundLoader.ReserveSoundID C# (CSharp) Method

ReserveSoundID() static private method

static private ReserveSoundID ( SoundType type ) : int
type SoundType
return int
        internal static int ReserveSoundID(SoundType type)
        {
            int reserveID = nextSound[type];
            nextSound[type]++;
            return reserveID;
        }

Usage Example

Ejemplo n.º 1
0
        public void AddSound(SoundType type, string soundPath, ModSound modSound = null)
        {
            int id = SoundLoader.ReserveSoundID(type);

            SoundLoader.sounds[type][soundPath] = id;
            if (modSound != null)
            {
                SoundLoader.modSounds[type][id] = modSound;
                modSound.sound = ModLoader.GetSound(soundPath);
            }
        }
All Usage Examples Of Terraria.ModLoader.SoundLoader::ReserveSoundID