コード例 #1
0
    void Update()
    {
        Selection();

        if (Input.GetKeyDown("z") && toolOpen)
        {
            UndoAction();
            successStates = 0;
        }

        if (Input.GetButtonDown("Open Inventory"))
        {
            TableToggle();
        }

        if (Input.GetButtonDown("Open Help Sheet"))
        {
            if (helpSheetOn)
            {
                helpSheetOn = false;
            }
            else
            {
                helpSheetOn = true;
            }
        }

        if (Input.GetButtonDown("Open Help Examples"))
        {
            if (helpExamplesOn)
            {
                helpExamplesOn = false;
            }
            else
            {
                helpExamplesOn = true;
            }
        }

        if (Input.GetButtonDown("Open Tool"))
        {
            ToolToggle();
            successStates = 0;
        }
        if (Input.GetButtonDown("Combine") && toolOpen)
        {
            if (Application.loadedLevelName.Equals("calibrationScene"))
            {
                useBackup = false;
                ToolToggle();
                ToolToggle();
                if (calibCounter == 0)
                {
                    taskManagement.CreateNewTrigger("communic_calibHard1");
                    calibCounter += 1;
                }
                else
                {
                    ToolToggle();
                    inventory.Remove("H");
                    inventory.Remove("C");
                    inventory.Remove("O");
                    inventory.Remove("N");
                    GameObject    player = GameObject.Find("Player");
                    AudioSource[] audios = player.GetComponents <AudioSource>();
                    audios[1].Play();
                    StartCoroutine(Earthquake());
                }
                useBackup = false;
                ToolToggle();
                ToolToggle();
            }
            else
            {
                string compound = taskManagement.Combine(toolContents, bondsLogic);
                if (compound == "None")
                {
                    Debug.Log("Not available");
                    successStates = 1;
                }
                else if (compound == "Bonds")
                {
                    successStates = 3;
                }
                else
                {
                    successStates = 2;
                    Debug.Log(compound);
                    InventoryFill(compound);
                    useBackup = false;
                    ToolToggle();
                    ToolToggle();
                }
            }
        }
        if (Input.GetButtonDown("Show Journal"))
        {
            journalShown = !journalShown;
            if (!inventoryOpen)
            {
                Screen.lockCursor = !journalShown;
            }
        }
    }