Exemplo n.º 1
0
    public void SetMode(StudioMode mode, bool refreshData = false)
    {
        this.mode = mode;
        typeView.gameObject.SetActive(mode == StudioMode.Type);
        itemCellView.gameObject.SetActive(mode == StudioMode.SelectItem);
        buildCellView.gameObject.SetActive(mode == StudioMode.SelectWall || mode == StudioMode.SelectFloor);
        editView.gameObject.SetActive(mode == StudioMode.EditItem);

        if (!refreshData)
        {
            return;
        }

        switch (mode)
        {
        case StudioMode.SelectItem:
            itemCellViewData = ItemData.GetAll();
            itemCellView.Refresh();
            break;

        case StudioMode.SelectWall:
            buildCellViewData = WallData.GetAll();
            buildCellView.Refresh();
            break;
        }
    }