public void Awake() { if (instance != null) { Destroy(gameObject); return; } ColorUtility.TryParseHtmlString("#1F2940", out offlineColor); ColorUtility.TryParseHtmlString("#FFFFFF", out onlineColor); statusButtonIcon.material.color = Color.white; instance = this; statusButton.onClick.AddListener(OnStatusButtonClicked); statusMenuButton.onClick.AddListener(OnStatusMenuButtonClicked); linkButton.onClick.AddListener(OnLinkButtonClicked); offlineStartButton.onClick.AddListener(OnOfflineStartButtonClicked); offlineStopButton.onClick.AddListener(OnOfflineStopButtonClicked); clearAssetCacheButton.onClick.AddListener(() => { CacheControlWindow.gameObject.SetActive(true); }); unlinkButton.onClick.AddListener(OnUnlinkButtonClicked); quitButton.onClick.AddListener(OnQuitButtonClicked); UpdateDropdown(); offlineDropdown.onValueChanged.AddListener(OnDropdownValueChanged); UpdateStatus(); }
public void Awake() { if (instance != null) { Destroy(gameObject); return; } SimulatorVersionText.text = $"Simulator Version: {CloudAPI.GetInfo().version}"; UnityVersionText.text = $"Unity Version: {Application.unityVersion}"; ColorUtility.TryParseHtmlString("#1F2940", out offlineColor); ColorUtility.TryParseHtmlString("#FFFFFF", out onlineColor); statusButtonIcon.material.color = Color.white; instance = this; statusButton.onClick.AddListener(OnStatusButtonClicked); statusMenuButton.onClick.AddListener(OnStatusMenuButtonClicked); linkButton.onClick.AddListener(OnLinkButtonClicked); offlineStartButton.onClick.AddListener(OnOfflineStartButtonClicked); offlineStopButton.onClick.AddListener(OnOfflineStopButtonClicked); clearAssetCacheButton.onClick.AddListener(() => { CacheControlWindow.gameObject.SetActive(true); }); LoadedAssetsButton.onClick.AddListener(() => { LoadedAssetsWindow.SetActive(true); }); unlinkButton.onClick.AddListener(OnUnlinkButtonClicked); quitButton.onClick.AddListener(OnQuitButtonClicked); SettingsButton.onClick.AddListener(OnSettingsButtonClicked); UpdateDropdown(); offlineDropdown.onValueChanged.AddListener(OnDropdownValueChanged); UpdateStatus(ConnectionManager.Status, ""); TaskProgressManager.Instance.OnUpdate += UpdateDownloadProgress; ConnectionManager.OnStatusChanged += UpdateStatus; }