Esempio n. 1
0
    public override void Click()
    {
        if (GameController.Instance().activePlayer.HaveRestaurant(this))
        {
            window = canvas.GetComponentInChildren <TilePopupUIManager>().OpenOwnedRestaurant();
            cameraScript.TurnCanMoveFalse();

            RestaurantUI ui = window.GetComponent <RestaurantUI>();
            ui.building = this;
            ui.UpdateRating();
            GameController.Instance().activePlayer.restaurantClicked = this;
            Debug.Log("Set restaurant reference" + this.GetInstanceID());
            ui.FillFields(name);
            //ui.FillChefs(); // fills chefs into the little scroll view on restaurant

            try
            {
                voiceScript.PlaySelectRestaurantVO((int)GameController.Instance().activePlayer.playerFaction.voice);
            }
            catch { }
        }
        else
        {
            window = canvas.GetComponentInChildren <TilePopupUIManager>().OpenEnemyRestaurant();
            RestaurantUI ui = window.GetComponent <RestaurantUI>();
            ui.building = this;
            GameController.Instance().activePlayer.restaurantClicked = this;
            //cameraScript.TurnCanMoveFalse();
        }
    }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Restaurant restaurant = new Restaurant("Öl", "Aleksanterinkatu 19",
                                                   new RestaurantManager("Jani", "Soronen", "041 999 333", "*****@*****.**"));

            restaurant.AddMenuTestData();

            RestaurantUI ui = new RestaurantUI(restaurant);

            ui.ShowMenu();
        }
Esempio n. 3
0
    public void OpenMenu()
    {
        restaurantScript = this.GetComponent <RestaurantUI>();

        //menuScript.PopulateMenu(restaurantScript.building);
        menuScript.PopulateMenu();

        menuPanel.gameObject.SetActive(true);

        //play sounds?
        AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid();
    }
Esempio n. 4
0
    public override void UnClick()
    {
        //added a menu clear function
        RestaurantUI ui = window.GetComponent <RestaurantUI>();

        ui.building = this;
        //ui.DeleteChefs();
        foreach (GameObject button in recipeButtons)
        {
            // Destroy(button);  // This was deleting all the buttons in menu hopefully it didn't mess something else up
        }
        canvas.GetComponentInChildren <TilePopupUIManager>().CloseUI();
    }
Esempio n. 5
0
    //double sliderValue = 0.0;

    public void Start()
    {
        // restUIScript = FindObjectOfType<RestaurantUI>();  // not geting a reference?
        restUIScript = GameObject.FindWithTag("RestUI").GetComponent <RestaurantUI>();
    }