Пример #1
0
    void Update()
    {
        Cursor.visible = cursorVisible;
        if (script.section == 2)
        {
            input.gameObject.SetActive(false);
        }

        //if (Input.anyKeyDown) {
        if ((Input.GetKey(KeyCode.RightAlt) || Input.GetKey(KeyCode.LeftAlt)) &&
            (Input.GetKey(KeyCode.RightControl) || Input.GetKey(KeyCode.LeftControl)) &&
            Input.GetKey(KeyCode.R))
        {
            Application.LoadLevel(Application.loadedLevel);
        }
        else if (Input.anyKeyDown || Input.GetKey(KeyCode.Mouse0))
        {
            manager.SetSelectedGameObject(input.gameObject);
        }

        if (jump)
        {
            jump = false;
            scroller.normalizedPosition = max;
        }

        if (script.section >= 2)           // once hit the third section, disable input controller
        {
            if (input.gameObject.activeSelf)
            {
                input.gameObject.SetActive(false);
            }
        }

        if (list_length != script.listLength())
        {
            list_length = script.listLength();
            int section = script.section;
            list[section] = "\n";
            for (int i = 0; i < list_length; i++)
            {
                list[section] += "\t" + script.names[section][i] + "\n";
            }
            list[section] += "\n";
        }
    }