private void ShowButton()
    {
        if (this.gameObject.transform.parent.name.Equals("ShowKarte(Clone)"))
        {
            if (ControllerScript.GetAdminMode())
            {
                if (!editButton.activeSelf)
                {
                    editButton.SetActive(true);
                }

                if (!deleteButton.activeSelf)
                {
                    deleteButton.SetActive(true);
                }
            }
            else
            {
                if (editButton.activeSelf)
                {
                    editButton.SetActive(false);
                }

                if (deleteButton.activeSelf)
                {
                    deleteButton.SetActive(false);
                }
            }
        }
    }
    private void StartStopwatch()
    {
        if (Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0 || ControllerScript.GetAdminMode() || !ControllerScript.schoner)
        {
            if (stopwatch.IsRunning)
            {
                stopwatch.Stop();
                stopwatch.Reset();
            }
        }
        else
        {
            if (!stopwatch.IsRunning)
            {
                stopwatch.Start();
            }
        }

        if (stopwatch.Elapsed.Seconds >= zeitBisSchoner)
        {
            if (!isActive)
            {
                isActive = true;

                lastCoro = StartCoroutine(StartSchoner());
            }
        }
        else
        {
            if (isActive)
            {
                isActive = false;

                StopCoroutine(lastCoro);

                speisearten.Clear();
                speisen.Clear();
            }
        }

        Invoke("StartStopwatch", 0);
    }
示例#3
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.F12) && logedIn)
        {
            ControllerScript.SetAdminMode(!ControllerScript.GetAdminMode());
        }

        if (Input.GetKey("escape"))
        {
            Application.Quit();
        }

        if (adminMode)
        {
            if (!createSpeise.activeSelf)
            {
                createSpeise.SetActive(true);
            }

            if (!editSpeiseArten.activeSelf)
            {
                editSpeiseArten.SetActive(true);
            }
        }
        else
        {
            if (createSpeise.activeSelf)
            {
                createSpeise.SetActive(false);
            }

            if (editSpeiseArten.activeSelf)
            {
                editSpeiseArten.SetActive(false);
            }
        }

        if (speiseArten.Length != 0)
        {
            schoner = true;
        }
    }