Fix conditional compilation.

This commit is contained in:
2023-01-01 20:07:58 +08:00
parent 2b5bc5dd08
commit e8f8593555
4 changed files with 7 additions and 1 deletions

View File

@@ -98,7 +98,7 @@ namespace Cryville.Common.Unity {
#elif UNITY_ANDROID
GameObject sbtn = GameObject.Instantiate<GameObject>(prefabButton);
sbtn.GetComponentInChildren<Text>().text = "Storage";
sbtn.GetComponentInChildren<Button>().onClick.AddListener(() => OnDriveChanged(new DirectoryInfo(androidStorage)));
sbtn.GetComponentInChildren<Button>().onClick.AddListener(() => ChangeDirectory(new DirectoryInfo(androidStorage)));
sbtn.transform.SetParent(drives, false);
#else
#error No update GUI logic

View File

@@ -73,7 +73,9 @@ namespace Cryville.Crtr.Browsing {
Application.LoadLevelAdditive("Play");
#endif
GameObject.Find("/Master").GetComponent<Master>().HideMenu();
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
DiscordController.Instance.SetPlaying(string.Format("{0} - {1}", detail.Meta.song.name, detail.Meta.name), detail.Meta.length);
#endif
}
public void OpenConfig(int id, ChartDetail detail) {

View File

@@ -284,7 +284,9 @@ namespace Cryville.Crtr {
#elif UNITY_5_3_OR_NEWER
SceneManager.UnloadScene("Play");
#endif
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
DiscordController.Instance.SetIdle();
#endif
}
#pragma warning restore IDE1006

View File

@@ -4,6 +4,7 @@ using UnityEngine;
namespace Cryville.Crtr {
internal class DiscordController : MonoBehaviour {
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
public static DiscordController Instance;
const long CLIENT_ID = 1059021675578007622L;
@@ -50,5 +51,6 @@ namespace Cryville.Crtr {
},
}, Callback);
}
#endif
}
}