コード例 #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();
        }
    }
コード例 #2
0
ファイル: Program.cs プロジェクト: Scrubi/MenuMasterTwo
        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();
        }
コード例 #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();
    }
コード例 #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();
    }
コード例 #5
0
    //double sliderValue = 0.0;

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