Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (canQuickCancel && screen.enabled && Input.GetKeyDown(KeyCode.Q))
     {
         UIRouter.goTo("OverWorld");
         inMainWorld.TransitionTo(2f);
         return;
     }
 }
Esempio n. 2
0
    void displayCity()
    {
        UIRouter.shop.unpopulate();

        UIRouter.shop.city = city;        //set shop to city
        Debug.Log("City selected " + UIRouter.shop.city.name);

        UIRouter.shop.populate(Game.Data.players.Find(x => x.name == "Mozzarella"));
        UIRouter.goTo("Shop");         //display shop
        inStore.TransitionTo(2f);
    }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         Debug.Log("Location: " + UIRouter.location);
     }
     if (UIRouter.location == "OverWorld" && Input.GetKeyDown(KeyCode.Q))
     {
         //Input.GetKeyDown (KeyCode.Escape) ||
         UIRouter.goTo("Inventory");
     }
 }
Esempio n. 4
0
    public static void Load()
    {
        Debug.Log(Application.persistentDataPath);
        if (File.Exists(Application.persistentDataPath + "/savedGames.gd"))
        {
            Debug.Log("Save found! loading now ^_^");
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/savedGames.gd", FileMode.Open);
            savedGames = (List <GameSave>)bf.Deserialize(file);
            file.Close();
        }
        else
        {
            Debug.Log("Save Not found!");
            Data = new GameSave();
            savedGames.Add(Data);
        }

        //TODO: write stuff for multiple saves
        Data = savedGames[0];        //if save was not selected select first save

        if (Data.players == null)    //Fix old saves.
        {
            Data.players = new List <Player>();
        }
        if (Data.players.Count == 0)
        {
            Player player1 = new Player("Mozzarella");
            foreach (Item i in AllItems)
            {
                player1.items.Add(new Item(i.name));
            }
            player1.items.Find(x => x.name == "Potatoes").count = 20;
            player1.money = 9700;             //TODO: remove hardcoded starting cash
            Data.players.Add(player1);
        }

        CityCtrl[] Cities = Object.FindObjectsOfType <CityCtrl> ();
        foreach (CityCtrl ctrl in Cities)
        {
            ctrl.enabled = true;
            AllCities.Add(ctrl.city);
        }

        UIRouter.goTo("OverWorld");
        Debug.Log("Going to overworld from load");
    }
Esempio n. 5
0
 public void runToOverWorld()
 {
     UIRouter.goTo("OverWorld");
     city = null;
 }
 public void runToOverWorld()
 {
     UIRouter.goTo("OverWorld");
 }
Esempio n. 7
0
 public void goTo(string canvas)
 {
     UIRouter.goTo(canvas);
 }
Esempio n. 8
0
 public void runToOverWorld()
 {
     UIRouter.goTo("OverWorld");
     inMainWorld.TransitionTo(2f);
 }