Created
June 6, 2013 20:40
-
-
Save MattRix/5724757 to your computer and use it in GitHub Desktop.
An alternative to enums. This is a response to this post: http://www.gamasutra.com/view/feature/193616/advanced_audio_streaming_in_unity.php?page=3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class AudioClipType | |
{ | |
static public List<AudioClipType> allAudioClipTypes = new List<AudioClipType>(); | |
static public AudioClipType SnakeEat = new AudioClipType("snake_eat","wav",1.0f); | |
static public AudioClipType UIPress = new AudioClipType("ui_press","wav",1.0f); | |
static public AudioClipType Explosion = new AudioClipType("explosion","wav",1.0f); | |
static public AudioClipType GameOver = new AudioClipType("game_over","wav",1.0f); | |
static public AudioClipType LevelUp = new AudioClipType("level_up","wav",1.0f); | |
static public AudioClipType StartGame = new AudioClipType("start_game","wav",1.0f); | |
static public AudioClipType PauseClick = new AudioClipType("pause_click","wav",1.0f); | |
static public AudioClipType PlayButton = new AudioClipType("play_button","ogg",1.0f) | |
public string name; | |
public string fileType; | |
public float volume; | |
public int priority; | |
public AudioClipType(string name, string fileType, float volume) | |
{ | |
this.name = name; | |
this.fileType = fileType; | |
this.volume = volume; | |
this.priority = allAudioClipTypes.Count; | |
allAudioClipTypes.Add(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment