Skip to content

Commit

Permalink
Fix a bug that setting of workspace directory is not reflected
Browse files Browse the repository at this point in the history
  • Loading branch information
setchi committed Oct 9, 2015
1 parent 368e1bd commit 249377d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Assets/Scripts/Presenter/MusicSelector/MusicSelectorPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ void Start()
{
ResetEditor();

Settings.WorkSpaceDirectoryPath
.Subscribe(workSpacePath => directoryPathInputField.text = workSpacePath + "/Musics/");

directoryPathInputField.OnValueChangeAsObservable()
.Subscribe(path => MusicSelector.DirectoryPath.Value = path);
MusicSelector.DirectoryPath.Subscribe(path => directoryPathInputField.text = path);
MusicSelector.DirectoryPath.Value = Settings.WorkSpaceDirectoryPath.Value + "/Musics/";

MusicSelector.DirectoryPath
.Subscribe(path => directoryPathInputField.text = path);


if (!Directory.Exists(MusicSelector.DirectoryPath.Value))
{
Expand Down Expand Up @@ -92,7 +97,7 @@ IEnumerator LoadMusic(string fileName)
void LoadEditData()
{
var fileName = Path.GetFileNameWithoutExtension(EditData.Name.Value) + ".json";
var directoryPath = Application.persistentDataPath + "/Notes/";
var directoryPath = MusicSelector.DirectoryPath.Value.Substring(0, MusicSelector.DirectoryPath.Value.Length - "/Musics/".Length) + "/Notes/";
var filePath = directoryPath + fileName;

if (File.Exists(filePath))
Expand Down

0 comments on commit 249377d

Please sign in to comment.