Beispiel #1
0
 public int OnCollideDoor(string dir)
 {
     if (!dir.Equals("Next") && currLayout.getDirection(dir).isShop)
     {
         OnEnterShop();
         shopUnlocked = true;
     }
     else
     {
         shopItems         = new Item[3];
         shopUnlocked      = false;
         shopItemBought[0] = false;
         shopItemBought[1] = false;
         shopItemBought[2] = false;
     }
     if (dir.Equals("Next"))
     {
         floorNum++;
         if (floorNum >= maps.Length)
         {
             return(13);
         }
         else
         {
             SceneTracker tracker = GameObject.Find("Game Engine").GetComponent <SceneTracker>();
             tracker.resetVals();
             currLayout = maps[floorNum];
             return(currLayout.currRoom.sceneNum);
         }
     }
     return(currLayout.goDirection(dir));
 }
Beispiel #2
0
    public void ExitButton()
    {
        EngineController engine = GameObject.Find("Game Engine").GetComponent <EngineController>();

        engine.resetVals();
        SceneTracker tracker = GameObject.Find("Game Engine").GetComponent <SceneTracker>();

        tracker.resetVals();
        //PlayerPrefs.DeleteAll();
        SceneManager.LoadScene("MainMenu");
    }