public static void UpdatePanel() { LoginPanelComponent loginPanelComponent = (LoginPanelComponent)UIPanelUtil.GetUIPanel(PanelType.LOGIN); Access access = AccessUtil.GetAccessData(); bool displayLogin = true; #if UNITY_EDITOR displayLogin = access.DevJsonPath != string.Empty; #else displayLogin = access.JsonPath != string.Empty; #endif loginPanelComponent.InputField_Username.enabled = displayLogin; loginPanelComponent.InputField_Token.enabled = displayLogin; loginPanelComponent.Button_Submit.enabled = displayLogin && loginPanelComponent.InputField_Token.text != string.Empty && loginPanelComponent.InputField_Username.text != string.Empty; if (!loginPanelComponent.Button_Submit.enabled) { loginPanelComponent.Button_Submit.image.color = loginPanelComponent.Button_Submit.colors.disabledColor; } else { loginPanelComponent.Button_Submit.image.color = Color.white; } }
public void SaveLoginSettings() { Manager manager = SingletonUtil.GetMain(); Access access = AccessUtil.GetAccessData(); LoginSettingsPanelComponent loginSettingsPanelComponent = (LoginSettingsPanelComponent)UIPanelUtil.GetUIPanel(PanelType.LOGIN_SETTINGS); #if UNITY_EDITOR access.DevJsonPath = loginSettingsPanelComponent.InputField_DevJsonPath.text; #endif access.JsonPath = loginSettingsPanelComponent.InputField_JsonPath.text; #if UNITY_EDITOR PlayerPrefs.SetString("DevJsonPath", access.DevJsonPath); #endif PlayerPrefs.SetString("JsonPath", access.JsonPath); #if UNITY_EDITOR if (loginSettingsPanelComponent.InputField_DevJsonPath.text != string.Empty) { ClientUtil.SetClient(); } #else if (loginSettingsPanelComponent.InputField_JsonPath.text != string.Empty) { ClientUtil.SetClient(); } #endif }