Пример #1
0
    public bool UseRoom103Key()
    {
        if (inventorySlotItems[currentlySelectedItemIndex] != null)
        {
            if (inventorySlotItems[currentlySelectedItemIndex].GetComponent <Item>().ItemName == "Room 103 Key")
            {
                RemoveItem("Room 103 Key");
                Timings.updateTimes("3-Rhys");
                Timings.RhysRoomFinished = true;
                Timings.lastScene        = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
                SaveInventory();
                UnityEngine.SceneManagement.SceneManager.LoadScene("0-Coridoor");
                return(true);
            }
        }

        return(false);
    }
Пример #2
0
    //Author of this function: Bethany Cawthorne
    //If an object is selected in the inventory, and the currently selected item is named 'screwdriver'
    //the screwdriver will be used to unscrew the vent and move onto the next level
    //The function also removes the screwdriverm and updates the level timings as the level is complete
    public bool UseScrewdriver()
    {
        if (inventorySlotItems[currentlySelectedItemIndex] != null)
        {
            if (inventorySlotItems[currentlySelectedItemIndex].GetComponent <Item>().ItemName == "Screwdriver")
            {
                if (FindItem("Screwdriver"))
                {
                    RemoveItem("Screwdriver");
                    Timings.updateTimes("4-Beth");
                    Timings.BethsRoomFinished = true;
                    Timings.lastScene         = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
                    SaveInventory();
                    UnityEngine.SceneManagement.SceneManager.LoadScene("3-Rhys");
                    return(true);
                }
            }
        }

        return(false);
    }
Пример #3
0
 //Quick access to each player's room on a key press for testing purposes
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.I))
     {
         SceneManager.LoadScene("1-Jacks");
     }
     else if (Input.GetKeyDown(KeyCode.O))
     {
         SceneManager.LoadScene("4-Beth");
     }
     else if (Input.GetKeyDown(KeyCode.P))
     {
         //When the player transitions, it updates the timings for the finished room
         Timings.updateTimes("4-Beth");
         SceneManager.LoadScene("3-Rhys");
     }
     //Quick way to get to the timings scene to get the times that the playtesters achieved in each room
     else if (Input.GetKeyDown(KeyCode.U))
     {
         SceneManager.LoadScene("Times");
     }
 }