예제 #1
0
    /// <summary>
    /// Initialize this FoodItemController by populating it with information from the provided parameters.
    /// </summary>
    /// <param name="dish">The dish that this controller is managing.</param>
    /// <param name="_gameSceneManager">The GameSceneManager that made a call to this controller.</param>
    public void Initialize(Dish dish, GameSceneManager _gameSceneManager)
    {
        // Store references to the GameSceneManager that initialized this FoodItemController, as well as the dish
        // being managed by this controller.
        this.gameSceneManager = _gameSceneManager;
        this.name             = dish.ToCamelCaseString();
        this.dishManaged      = dish;

        // Set this controller's dish's image.
        this.image.sprite = GameSceneManager.GetDishSprite(dish);
    }
예제 #2
0
 /// <summary>
 /// Initialize this dish by setting it to the dish <param name="dish"></param>.
 /// </summary>
 /// <param name="dish">The dish to set this object to.</param>
 public void Initialize(Dish dish)
 {
     dishImage.sprite = GameSceneManager.GetDishSprite(dish);
     dishText.text    = dish.ToTitleCaseSpacedString();
     thisDish         = dish;
 }