public void thirdPersonClick() { Transform mainCamera = GameObject.Find("Main Camera").transform; CameraController controller = mainCamera.GetComponent <CameraController>(); LoadSaveMenu lsm = GameObject.Find("Canvas").transform.Find("LoadSave Menu").GetComponent <LoadSaveMenu>(); if (lsm.scene.controller != null) { Alert.Alert alertdialog = new Alert.Alert(); alertdialog.openInteractableAlertDialog("ERROR", "A Controller already exists. Please remove the other controller first..."); return; } lsm.scene.controller = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/Ethan/ThirdPersonController")); lsm.scene.controller.AddComponent <CameraVanMouseHandler>(); lsm.scene.controller.tag = "CameraVan"; lsm.scene.controller.name = "Third Person (Ethan)"; lsm.scene.controller.transform.position = mainCamera.position + mainCamera.forward * 10.0f; controller.target = lsm.scene.controller.transform; }
public void thirdPersonClick() { Transform mainCamera = GameObject.Find("Main Camera").transform; CameraController controller = mainCamera.GetComponent<CameraController>(); LoadSaveMenu lsm = GameObject.Find("Canvas").transform.Find("LoadSave Menu").GetComponent<LoadSaveMenu>(); if (lsm.scene.controller != null) { Alert.Alert alertdialog = new Alert.Alert(); alertdialog.openInteractableAlertDialog("ERROR", "A Controller already exists. Please remove the other controller first..."); return; } lsm.scene.controller = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/Ethan/ThirdPersonController")); lsm.scene.controller.AddComponent<CameraVanMouseHandler>(); lsm.scene.controller.tag = "CameraVan"; lsm.scene.controller.name = "Third Person (Ethan)"; lsm.scene.controller.transform.position = mainCamera.position + mainCamera.forward * 10.0f; controller.target = lsm.scene.controller.transform; }
public void RunTask() { try { _appContext.GwupeService.Ping(); if (_serviceAlert != null) { _appContext.NotificationManager.DeleteAlert(_serviceAlert); _serviceAlert = null; Logger.Info("GwupeService has recovered and is available"); // As a temporary fault report, we need to see if the restart worked // remove this after this bug is concluded fixed ThreadPool.QueueUserWorkItem( state => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport(new FaultReport() { Subject = "Service restart success", UserReport = "Not a fault, it was restarted ok." })); } } catch (Exception e) { Logger.Error("GwupeService is not available : " + e.Message); if (_serviceAlert == null) { // this is the first time we have seen this. _serviceAlert = new Alert.Alert { Message = "Gwupe Service Unavailable", ClickCommand = ClickRestartGwupeService }; _appContext.NotificationManager.AddAlert(_serviceAlert); SentFaultReport = false; } else { // we only want to know the second time it happens (because of upgrades) if (!SentFaultReport) { SentFaultReport = true; ThreadPool.QueueUserWorkItem( state => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport(new FaultReport() { Subject = "Service unavailable error", UserReport = "Detected gwupe service unavailable." })); // Lets try restart it try { if (!GwupeClientAppContext.CurrentAppContext.RestartGwupeService()) { throw new Exception("Automatic restart of Gwupe failed"); } RunTask(); } catch (Exception) { // crap, we couldn't restart it. ThreadPool.QueueUserWorkItem( state => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport(new FaultReport() { Subject = "Auto service restart failed", UserReport = "Failed to automatically restart gwupe service." })); } } } } }
public void RunTask() { try { _appContext.GwupeService.Ping(); if (_serviceAlert != null) { _appContext.NotificationManager.DeleteAlert(_serviceAlert); _serviceAlert = null; Logger.Info("GwupeService has recovered and is available"); // As a temporary fault report, we need to see if the restart worked // remove this after this bug is concluded fixed ThreadPool.QueueUserWorkItem( state => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport(new FaultReport() { Subject = "Service restart success", UserReport = "Not a fault, it was restarted ok." })); } } catch (Exception e) { Logger.Error("GwupeService is not available : " + e.Message); if (_serviceAlert == null) { // this is the first time we have seen this. _serviceAlert = new Alert.Alert { Message = "Gwupe Service Unavailable", ClickCommand = ClickRestartGwupeService }; _appContext.NotificationManager.AddAlert(_serviceAlert); SentFaultReport = false; } else { // we only want to know the second time it happens (because of upgrades) if (!SentFaultReport) { SentFaultReport = true; ThreadPool.QueueUserWorkItem( state => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport(new FaultReport() { Subject = "Service unavailable error", UserReport = "Detected gwupe service unavailable." })); // Lets try restart it try { if (!GwupeClientAppContext.CurrentAppContext.RestartGwupeService()) { throw new Exception("Automatic restart of Gwupe failed"); } RunTask(); } catch (Exception) { // crap, we couldn't restart it. ThreadPool.QueueUserWorkItem( state => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport(new FaultReport() { Subject = "Auto service restart failed", UserReport = "Failed to automatically restart gwupe service." })); } } } } }