protected override void Initialize() { signinView = ViewsManager.GetView <SignIn_View>("SigninView"); signupView = ViewsManager.GetView <SignUp_View>("SignupView"); passwordResetView = ViewsManager.GetView <PasswordReset_View>("PasswordResetView"); passwordResetCodeView = ViewsManager.GetView <PasswordResetCode_View>("PasswordResetCodeView"); emailConfirmationView = ViewsManager.GetView <EmailConfirmation_View>("EmailConfirmationView"); MsfTimer.WaitForEndOfFrame(() => { if (useDefaultCredentials && Application.isEditor) { signinView.SetInputFieldsValues(defaultUsername, defaultPassword); signupView.SetInputFieldsValues(defaultUsername, defaultEmail, defaultPassword); } if (IsConnected) { Msf.Events.Invoke(Event_Keys.hideLoadingInfo); signinView.Show(); } else { Msf.Events.Invoke(Event_Keys.showLoadingInfo, "Connecting to master server... Please wait!"); } }); }
protected override void OnBeforeClientConnectedToServer() { DestroyUnwanted(); // Set cliet mode Msf.Client.Rooms.ForceClientMode = true; // Set MSF global options Msf.Options.Set(MsfDictKeys.autoStartRoomClient, true); Msf.Options.Set(MsfDictKeys.offlineSceneName, SceneManager.GetActiveScene().name); mainView = ViewsManager.GetView <MainView>("MainView"); createNewRoomView = ViewsManager.GetView <CreateNewRoomView>("CreateNewRoomView"); gamesListView = ViewsManager.GetView <GamesListView>("GamesListView"); if (!Msf.Client.Auth.IsSignedIn) { Msf.Events.Invoke(EventKeys.showLoadingInfo, "Signing in... Please wait!"); } else { Msf.Events.Invoke(EventKeys.hideLoadingInfo); } if (Connection.IsConnected) { OnClientConnectedToServer(); } else { FindObjectOfType <ClientToMasterConnector>()?.StartConnection(); } }
protected override void OnBeforeClientConnectedToServer() { signinView = ViewsManager.GetView <SignInView>("SigninView"); signupView = ViewsManager.GetView <SignUpView>("SignupView"); passwordResetView = ViewsManager.GetView <PasswordResetView>("PasswordResetView"); passwordResetCodeView = ViewsManager.GetView <PasswordResetCodeView>("PasswordResetCodeView"); emailConfirmationView = ViewsManager.GetView <EmailConfirmationView>("EmailConfirmationView"); Msf.Client.Auth.RememberMe = rememberUser; MsfTimer.WaitForEndOfFrame(() => { if (useDefaultCredentials && Application.isEditor) { signinView.SetInputFieldsValues(defaultUsername, defaultPassword); signupView.SetInputFieldsValues(defaultUsername, defaultEmail, defaultPassword); } //if (IsConnected) //{ // Msf.Events.Invoke(EventKeys.hideLoadingInfo); // signinView.Show(); //} //else //{ // Msf.Events.Invoke(EventKeys.showLoadingInfo, "Connecting to master server... Please wait!"); //} }); }
protected override void OnInitialize() { // Set cliet mode Msf.Client.Rooms.ForceClientMode = true; // Set MSF global options Msf.Options.Set(MsfDictKeys.autoStartRoomClient, true); Msf.Options.Set(MsfDictKeys.offlineSceneName, SceneManager.GetActiveScene().name); createNewRoomView = ViewsManager.GetView <CreateNewRoomView>("CreateNewRoomView"); }
protected override void Start() { base.Start(); helpViewSummaryPanel = ViewsManager.GetView <UIView>("HelpViewSummaryPanel"); helpOutput = ChildComponent <TextMeshProUGUI>("helpOutput"); if (helpOutput) { helpOutput.text = helpText.text; } }
protected override void Initialize() { profileView = ViewsManager.GetView <Profile_View>("ProfileView"); profileSettingsView = ViewsManager.GetView <ProfileSettings_View>("ProfileSettingsView"); Profile = new ObservableProfile { new ObservableString((short)ObservablePropertyCodes.DisplayName) }; Profile.OnPropertyUpdatedEvent += OnPropertyUpdatedEventHandler; }
protected override void OnInitialize() { profileView = ViewsManager.GetView<ProfileView>("ProfileView"); profileSettingsView = ViewsManager.GetView<ProfileSettingsView>("ProfileSettingsView"); Profile = new ObservableProfile { new ObservableString((short)ObservablePropertiyCodes.DisplayName), new ObservableString((short)ObservablePropertiyCodes.Avatar), new ObservableFloat((short)ObservablePropertiyCodes.Bronze), new ObservableFloat((short)ObservablePropertiyCodes.Silver), new ObservableFloat((short)ObservablePropertiyCodes.Gold) }; Profile.OnPropertyUpdatedEvent += OnPropertyUpdatedEventHandler; }
protected override void Initialize() { loginView = ViewsManager.GetView <Login_View>("LoginView"); createAccountView = ViewsManager.GetView <CreateAccount_View>("CreateAccount"); resetPassword_View = ViewsManager.GetView <ResetPasswordRequest_View>("ResetPasswordRequest"); passwordResetEntry_View = ViewsManager.GetView <PasswordResetEntry_View>("PasswordResetEntry"); emailConfirmationView = ViewsManager.GetView <EmailConfirmation_View>("EmailConfirmationView"); rememberToggle = GameObject.Find("RememberToggle").GetComponent <Toggle>(); MsfTimer.WaitForEndOfFrame(() => { CheckPlayerPrefs(); if (IsConnected) { Msf.Events.Invoke(Event_Keys.hideLoadingInfo); } }); }
protected override void OnInitialize() { FindOrCreateMasterConnector(); signinView = ViewsManager.GetView <SignInView>("SigninView"); signupView = ViewsManager.GetView <SignUpView>("SignupView"); passwordResetView = ViewsManager.GetView <PasswordResetView>("PasswordResetView"); passwordResetCodeView = ViewsManager.GetView <PasswordResetCodeView>("PasswordResetCodeView"); emailConfirmationView = ViewsManager.GetView <EmailConfirmationView>("EmailConfirmationView"); Msf.Client.Auth.RememberMe = rememberUser; MsfTimer.WaitForEndOfFrame(() => { if (useDefaultCredentials && Application.isEditor) { if (signinView) { signinView.SetInputFieldsValues(defaultUsername, defaultPassword); } if (signupView) { signupView.SetInputFieldsValues(defaultUsername, defaultEmail, defaultPassword); } } Connection.AddConnectionListener(OnClientConnectedToServer); Connection.AddDisconnectionListener(OnClientDisconnectedFromServer, false); if (!Connection.IsConnected && !Connection.IsConnecting) { Msf.Events.Invoke(MsfEventKeys.showLoadingInfo, "Connecting to master... Please wait!"); clientToMasterConnector.StartConnection(); } }); }