static public IView CreateView(AvailableItemListView viewComponent, AvailableItemListView.ViewType viewType)
    {
        IView view = null;

        switch (viewType)
        {
        case AvailableItemListView.ViewType.Text:
            view = new TextView()
            {
                Prefab = viewComponent.AvailableItemTextPrefab
            };
            break;

        case AvailableItemListView.ViewType.Silhouette:
            view = new SilhouetteView()
            {
                Prefab = viewComponent.AvailableItemSilhouettePrefab
            };
            break;

        default:
            throw new UnityException("Unsupported view type " + viewType);
        }

        return(view);
    }
Esempio n. 2
0
    public void Init (AvailableItemListView.ViewType viewType, bool timeMode, TextAsset dataBase) {
        ViewType = viewType;
        DataBase = dataBase; 

        if (!timeMode)
        {
            if (TimerView != null)
                Destroy(TimerView.gameObject);

            if (Timer != null)
                Destroy(Timer);
        }

        AvailableItemListView.Init();
        InitPickabbleItemsController();       
    }