Inheritance: MonoBehaviour
Beispiel #1
0
        /// <summary>
        /// Removes all paths that don't exist and fills the list of tracks according to paths remainig
        /// </summary>
        public void Recover()
        {
            Paths.RemoveAll(path => !File.Exists(path));

            foreach (string path in Paths)
            {
                Tracks.Add(AudioDictionary.GetAudio(path));
            }
        }
Beispiel #2
0
    public static void CreateAudioDictionary()
    {
        AudioDictionary asset = ScriptableObject.CreateInstance <AudioDictionary>();

        AssetDatabase.CreateAsset(asset, "Assets/Resources/AudioDictionary.asset");
        AssetDatabase.SaveAssets();

        EditorUtility.FocusProjectWindow();

        Selection.activeObject = asset;
    }
Beispiel #3
0
    public override void Play(string AudioName)
    {
        if (!AudioDictionary.ContainsKey(AudioName))
        {
            Debug.Log(gameObject.name + "에 " + AudioName + "라는 AudioClip이 없습니다.");
            return;
        }

        int index = Random.Range(0, AudioDictionary[AudioName].Length);

        AudioDictionary[AudioName][index].Play();
    }
Beispiel #4
0
        /// <summary>
        /// Searches for the audiofiles in the chosen folder
        /// </summary>
        private static void SearchAudioFiles()
        {
            Files = new ObservableList <IAudio>();

            if (SystemState.Instance.LibraryPath != null)
            {
                var audios = Directory.EnumerateFiles((SystemState.Instance.LibraryPath), "*.*", SearchOption.AllDirectories)
                             .Where(s => s.EndsWith(".mp3") || s.EndsWith(".flac") || s.EndsWith(".wav"));

                foreach (string f in audios)
                {
                    Files.Add(AudioDictionary.GetAudio(f));
                }
            }
        }
Beispiel #5
0
	public Spell(string name = null) {
		this.name = name;

		this.audioDict = GameObject.Find ("AudioDictionary").GetComponent<AudioDictionary> ();

		WinAnimationInitialize ();

		this.theme = GameObject.Find ("ThemeSource");

//		this.winBox = GameObject.Find ("Canvas").GetCom("RainWinBox");

//		foreach (Transform t in GameObject.Find("Canvas").transform) {
//			if (t.name == "RainWinBox") {
//				t.GetComponent<CanvasRenderer>().
//			}
//		}
		this.loseBox = GameObject.Find ("RainLoseBox");
	}
Beispiel #6
0
    public Spell(string name = null)
    {
        this.name = name;

        this.audioDict = GameObject.Find("AudioDictionary").GetComponent <AudioDictionary> ();

        WinAnimationInitialize();

        this.theme = GameObject.Find("ThemeSource");

//		this.winBox = GameObject.Find ("Canvas").GetCom("RainWinBox");

//		foreach (Transform t in GameObject.Find("Canvas").transform) {
//			if (t.name == "RainWinBox") {
//				t.GetComponent<CanvasRenderer>().
//			}
//		}
        this.loseBox = GameObject.Find("RainLoseBox");
    }
Beispiel #7
0
 public void Initialize()
 {
     _audioDictionary = Resources.Load <AudioDictionary>("AudioDictionary");
 }
 void Start()
 {
     musicAudioSource = GameObject.Find("Audio_Music").GetComponent <AudioSource>(); // Finds the music Audio Source.
     _dictionary      = this.gameObject.GetComponent <AudioDictionary>();            // Finds the Dictionary.
 }