Esempio n. 1
0
    //also used to go there in the first place :D
    public void Return(string input)
    {
        switch (input)
        {
        case "fromMain":
        {
            OnOptions?.Invoke();
            mainMenu.SetActive(false);
            pauseMenu.SetActive(false);
            optionsMenu.SetActive(true);
        }
        break;

        case "fromOptions":
        {
            OnMain?.Invoke();
            if (pauseMode)
            {
                pauseMenu.SetActive(true);
                optionsMenu.SetActive(false);
            }
            else
            {
                mainMenu.SetActive(true);
                optionsMenu.SetActive(false);
            }
        }
        break;
        }
    }
Esempio n. 2
0
        private void handleRequest(HttpListenerContext context)
        {
            var eventArgs = new HttpEventArgs(context.Request, context.Response);
            var method    = context.Request.HttpMethod;

            try
            {
                if (method == HttpMethod.Get.Method)
                {
                    OnGet?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Post.Method)
                {
                    OnPost?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Put.Method)
                {
                    OnPut?.Invoke(this, eventArgs);
                }
                else if (method == HttpMethod.Options.Method)
                {
                    OnOptions?.Invoke(this, eventArgs);
                }
            }
            catch (NotImplementedException)
            {
                context.Response.Abort();
            }
        }
Esempio n. 3
0
 public void PressOptions()
 {
     OnOptions?.Invoke();
     Hide();
 }