// Handle detecting incoming invitations. public void UpdateInvitation() { if (InvitationManager.Instance == null) { return; } // if an invitation arrived, switch to the "invitation incoming" GUI // or directly to the game, if the invitation came from the notification Invitation inv = InvitationManager.Instance.Invitation; if (inv != null) { if (InvitationManager.Instance.ShouldAutoAccept) { // jump straight into the game, since the user already indicated // they want to accept the invitation! InvitationManager.Instance.Clear(); RaceManager.AcceptInvitation(inv.InvitationId); NavigationUtil.ShowPlayingPanel(); } else { // show the "incoming invitation" screen NavigationUtil.ShowInvitationPanel(); } } }
// Use this for initialization void Start() { mAuthCallback = (bool success) => { Debug.Log("In Auth callback, success = " + success); mSigningIn = false; if (success) { NavigationUtil.ShowMainMenu(); } else { Debug.Log("Auth failed!!"); } }; // enable debug logs (note: we do this because this is a sample; // on your production app, you probably don't want this turned // on by default, as it will fill the user's logs with debug info). var config = new PlayGamesClientConfiguration.Builder() .WithInvitationDelegate(InvitationManager.Instance.OnInvitationReceived) .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; // try silent authentication if (mAuthOnStart) { Authorize(true); } }
void OnBackButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; Page page = (Page)Activator.CreateInstance(typeof(EventsPage)); NavigationUtil.SwitchDetailPage(page); }
public void testNavReturnsPathWithLineOfSight() { prepDependencies(false); NavigationUtil util = kernel.Get <NavigationUtil>(); Assert.IsNotNull(util.findDamageableInRadiusWithLineOfSightPath(Vector3.zero, 10, 1 << kernel.Get <ILayerMask>().NameToLayer("UNDEAD"))); }
void OnRidesButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; Int32 eventId = (Int32)button.CommandParameter; RidesPage page = new RidesPage(eventId);//(RidesPage)Activator.CreateInstance(typeof(RidesPage)); NavigationUtil.SwitchDetailPage(page); }
public LoginPage() { InitializeComponent(); if (UserService.getInstance().GetUser() != null) { NavigationUtil.SwitchDetailPage(typeof(EventsPage), "Events"); } }
void OnOfferRideButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; OrgEvent orgEvent = (OrgEvent)button.CommandParameter; OfferRidesPage page = new OfferRidesPage(orgEvent); NavigationUtil.SwitchDetailPage(page); }
// Handler script for the decline button. public void OnDecline() { if (processed) { return; } processed = true; InvitationManager.Instance.DeclineInvitation(); NavigationUtil.ShowMainMenu(); }
private void OnNavigationClicked(NavigationType navigationType) { var grid = _container.GetItemsGrid(); var currentItemPos = DetectCurrentItemPos(grid); var targetItem = NavigationUtil.GetTarget(grid, currentItemPos, navigationType); if (targetItem != null && !targetItem.IsBlockForInput) { FormModel.SelectedItem = targetItem.Model; FormModel.SetChanges(); } }
void OnJoinButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; Int16 orgId = (Int16)button.CommandParameter; User user = UserService.getInstance().GetUser(); if (!user.Organizations.Contains(orgId)) { user.Organizations.Add(orgId); UserService.getInstance().SaveUser(user); Console.WriteLine("Org ID " + orgId + " is added"); NavigationUtil.SwitchDetailPage(typeof(EventsPage), "events"); } }
// Update is called once per frame void Update() { HandleStatusUpdate(); UpdateInvitation(); if (RaceManager.Instance == null) { return; } switch (RaceManager.Instance.State) { case RaceManager.RaceState.SettingUp: if (statusText != null) { //reset the timer, we can stay here for a long time. mStatusMsg = null; ShowStatus("Waiting for opponents...", false); } break; case RaceManager.RaceState.SetupFailed: ShowStatus("Game setup failed", true); RaceManager.Instance.CleanUp(); processed = false; break; case RaceManager.RaceState.Aborted: ShowStatus("Race Aborted.", true); RaceManager.Instance.CleanUp(); processed = false; break; case RaceManager.RaceState.Finished: // really should not see this on the main menu page, // so go to playing panel to display the final outcome of the race. NavigationUtil.ShowPlayingPanel(); processed = false; break; case RaceManager.RaceState.Playing: NavigationUtil.ShowPlayingPanel(); processed = false; break; default: Debug.Log("RaceManager.Instance.State = " + RaceManager.Instance.State); break; } }
void OnLoginButtonClicked(object sender, EventArgs e) { User user = UserService.getInstance().GetUser(emailEntry.Text, passwordEntry.Text); if (user != null) { NavigationUtil.SwitchDetailPage(typeof(EventsPage), "Events"); } else { messageLabel.Text = "Login failed"; passwordEntry.Text = string.Empty; } }
// Update is called once per frame void LateUpdate() { // TODO: Haven't found a solution for it, but this can maybe be more optimized // Check if vehicle is still on-route if (!_startedPathFinding || !NavigationUtil.PathComplete(_agent)) { return; } // We are not marked to destroy, so we're driving back to were we came from _startedPathFinding = false; _drivingBack = !_drivingBack; StartPathFinding(false); }
public MainViewModel() { CurrentView = new HomeViewModel(); NavigationUtil.Register("Home", GoToHome); NavigationUtil.Register("FirmwareUpdate", GoToUpdateFirmware); NavigationUtil.Register("ScpExport", GoToScpExport); NavigationUtil.Register("ScpImport", GoToScpImport); NavigationUtil.Register("CustomScript", GoToCustomScript); NavigationUtil.Register("GetProcessorAndCore", GoToGetProcessorAndCore); NavigationUtil.Register("GetProcessorInternet", GoToGetProcessorInternet); NavigationUtil.Register("SearchIdrac", GoToSearchIdrac); NavigationUtil.Register("ChangeIp", GoToChangeIp); NavigationUtil.Register("ScpExportList", GoToScpExportList); SettingsCommand = new RelayCommand(Settings); }
//Handler for the signout button. public void OnSignoutClicked() { if (RaceManager.Instance != null) { RaceManager.Instance.CleanUp(); } Debug.Log("Signing out..."); if (PlayGamesPlatform.Instance != null) { PlayGamesPlatform.Instance.SignOut(); } else { Debug.Log("PG Instance is null!"); } NavigationUtil.ShowGameMenu(); }
// Update is called once per frame void Update() { inv = (inv != null) ? inv : InvitationManager.Instance.Invitation; if (inv == null && !processed) { Debug.Log("No Invite -- back to main"); NavigationUtil.ShowMainMenu(); return; } if (inviterName == null) { inviterName = (inv.Inviter == null || inv.Inviter.DisplayName == null) ? "Someone" : inv.Inviter.DisplayName; message.text = inviterName + " is challenging you to a quiz race!"; } if (RaceManager.Instance != null) { switch (RaceManager.Instance.State) { case RaceManager.RaceState.Aborted: Debug.Log("Aborted -- back to main"); NavigationUtil.ShowMainMenu(); break; case RaceManager.RaceState.Finished: Debug.Log("Finished-- back to main"); NavigationUtil.ShowMainMenu(); break; case RaceManager.RaceState.Playing: NavigationUtil.ShowPlayingPanel(); break; case RaceManager.RaceState.SettingUp: message.text = "Setting up Race..."; break; case RaceManager.RaceState.SetupFailed: Debug.Log("Failed -- back to main"); NavigationUtil.ShowMainMenu(); break; } } }
protected override void OnAppearing() { base.OnAppearing(); User user = UserService.getInstance().GetUser(); if (user != null) { if (user.Organizations.Count > 0) { NavigationUtil.SwitchDetailPage(typeof(EventsPage), "Events"); } else { NavigationUtil.SwitchDetailPage(typeof(OrganizationPicker), "Join Organization"); } } }
// Update is called once per frame void Update() { // Check if we have a target and if we are actually at the target if (HasTarget && NavigationUtil.PathComplete(_agent)) { if (!_rotating && Target != null) { _agent.isStopped = true; // We stopped rotating so we are ready to fire if (IsFiringEnabled) { Fire(); } else { RemoveTarget(); } } } }
private void FirmwareUpdatePage(object parameter) { NavigationUtil.NotifyColleagues("FirmwareUpdate", null); }
public async void SelectedItemCommandTapped(JSONCity city) { await NavigationUtil.PushAsync(new WeatherInformation(city)); }
public void OnRegisterButtonClicked(object sender, EventArgs e) { NavigationUtil.SwitchDetailPage(typeof(RegisterPage), "Register"); }
private void ScpExportListPage(object parameter) { NavigationUtil.NotifyColleagues("ScpExportList", null); }
private void ChangeIpPage(object parameter) { NavigationUtil.NotifyColleagues("ChangeIp", null); }
private void SearchIdracPage(object parameter) { NavigationUtil.NotifyColleagues("SearchIdrac", null); }
private void GetProcessorInternetPage(object parameter) { NavigationUtil.NotifyColleagues("GetProcessorInternet", null); }
private void GetProcessorAndCorePage(object parameter) { NavigationUtil.NotifyColleagues("GetProcessorAndCore", null); }
private void CustomScriptPage(object parameter) { NavigationUtil.NotifyColleagues("CustomScript", null); }
//Handles resetting the gamepad state then navigating to the main menu. void ShowMainMenu() { EnableGamepad(false); NavigationUtil.ShowMainMenu(); }
private async void SearchCitiesCommandTapped() { await NavigationUtil.PushAsync(new CitiesList()); }