Disables file watcher during gameplay.
This commit is contained in:
@@ -11,6 +11,9 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
[Obsolete]
|
[Obsolete]
|
||||||
IReadOnlyDictionary<string, string> GetPresetPaths();
|
IReadOnlyDictionary<string, string> GetPresetPaths();
|
||||||
|
|
||||||
|
void Activate();
|
||||||
|
void Deactivate();
|
||||||
|
|
||||||
event Action ItemChanged;
|
event Action ItemChanged;
|
||||||
}
|
}
|
||||||
public interface IPathedResourceManager<T> : IResourceManager<T> {
|
public interface IPathedResourceManager<T> : IResourceManager<T> {
|
||||||
|
|||||||
@@ -47,6 +47,14 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
ReloadFiles();
|
ReloadFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Activate() {
|
||||||
|
_watcher.EnableRaisingEvents = !string.IsNullOrEmpty(_watcher.Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Deactivate() {
|
||||||
|
_watcher.EnableRaisingEvents = false;
|
||||||
|
}
|
||||||
|
|
||||||
void ReloadFiles() {
|
void ReloadFiles() {
|
||||||
_items = _cd.GetDirectories();
|
_items = _cd.GetDirectories();
|
||||||
_version++;
|
_version++;
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
InitDialog();
|
InitDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnEnable() {
|
||||||
|
ResourceManager.Activate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDisable() {
|
||||||
|
ResourceManager.Deactivate();
|
||||||
|
}
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
protected void InitDialog() {
|
protected void InitDialog() {
|
||||||
_dialog = Instantiate(Resources.Load<GameObject>("Common/FileDialog")).GetComponent<FileDialog>();
|
_dialog = Instantiate(Resources.Load<GameObject>("Common/FileDialog")).GetComponent<FileDialog>();
|
||||||
|
|||||||
Reference in New Issue
Block a user