Esempio n. 1
0
 public override void OnWindowClose()
 {
     if (!_shouldSave)
     {
         return;
     }
     GameRegistry.SetValue("CUR_SONG", _fileName);
     SongEditor.instance.SaveSong(null);
 }
Esempio n. 2
0
        private void Create()
        {
            GameRegistry.SetValue("CUR_SONG", songNameField.text);
            Directory.CreateDirectory(songPath);
            string file = songPath + "/Song" + Path.GetExtension(_selectedFile);

            if (File.Exists(file))
            {
                File.Delete(file);
            }
            File.Copy(_selectedFile, file);
            Song song = new Song("/" + songNameField.text + "/Song" + Path.GetExtension(_selectedFile), 3);

            song.info.title = songNameField.text;
            _fe.CreateSong(song);
        }
Esempio n. 3
0
 void Start()
 {
     //Set the Data path
     _dataPath = Application.dataPath + "/Songs/";
     //Cache the audio source
     _src = GetComponent <AudioSource>();
     if (GameRegistry.GetString("CUR_SONG") == null)
     {
         GameRegistry.SetValue("CUR_SONG", "SongName");
     }
     byte[] songData = File.ReadAllBytes(_dataPath + GameRegistry.GetString("CUR_SONG") + "/Song.SongData");
     _song = Song.loadSong(songData);
     EventManager.StartListening("loadSong", SongReady);
     StartCoroutine(_song.LoadAudioClip("loadSong"));
     _loadTimer = Time.time;
     //_src.clip = _song.song;
     //_songLength = _src.clip.length;
 }
Esempio n. 4
0
 //Exit Editor
 public void ExitEditor(object arg)
 {
     GameRegistry.SetValue("isEditing", false);
     SceneManager.LoadScene(0);
 }
Esempio n. 5
0
 //Play Song
 public void PlaySong(object arg)
 {
     SaveSong(null);
     GameRegistry.SetValue("isEditing", true);
     SceneManager.LoadScene("main");
 }
Esempio n. 6
0
 public void LoadSong()
 {
     GameRegistry.SetValue("CUR_SONG", Path.GetFileNameWithoutExtension(_selectedFile));
     SceneManager.LoadScene("songEditor");
     CloseWindow();
 }