private void HandleContext(HttpListenerContext context) { var failed = true; try { if (context.Request.Url.AbsolutePath != "/notification") { return; } if (context.Request.HttpMethod != "POST") { return; } using (var reader = new StreamReader(context.Request.InputStream)) { var body = reader.ReadToEnd(); var json = new JSONObject(body); var not = Notification.FromJson(json); NotificationPanel.Show(not); } failed = false; context.Response.StatusCode = (int)HttpStatusCode.OK; } finally { if (failed) { context.Response.StatusCode = (int)HttpStatusCode.Forbidden; } context.Response.Close(); } }
IEnumerator HandlePanelShowAndHide(NotificationPanel panel) { activePanels++; yield return(panel.Show(activePanels)); yield return(new WaitForSeconds(2f)); yield return(panel.Hide()); Destroy(panel.gameObject); activePanels--; }
public void Notification(string msg) { notificationPanel.Show(msg); }
public void Notification(string message) { notificationPanel.Show(message); }