예제 #1
0
        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
        }
예제 #2
0
        void OnApplicationQuit()
        {
            if (Simulation.Backend == null)
            {
                return;
            }

            Client.Connected = false;
            Client.Followers.Clear();
            ClientUtil.SetClient();

            Simulation.Backend.CloseMainWindow();
        }
예제 #3
0
        public void Login()
        {
            LoginPanelComponent loginPanelComponent = (LoginPanelComponent)UIPanelUtil.GetUIPanel(PanelType.LOGIN);

            Client client = ClientUtil.GetClient();

            client.UserName     = loginPanelComponent.InputField_Username.text;
            client.AccessToken  = loginPanelComponent.InputField_Token.text;
            client.ReadMessages = false;
            client.Followers    = new List <Follower>();

            ClientUtil.SetClient();

            Simulation       simulation = SimulationUtil.GetSimulation();
            ProcessStartInfo backEnd    = new ProcessStartInfo();

            backEnd.FileName         = "TwitchChat_bckEnd.exe";
            backEnd.WorkingDirectory = AccessUtil.GetBackEndProcessPath();
            simulation.Backend       = Process.Start(backEnd);
        }