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); }
public Transform CreateItem(Transform parent) { if (Prefab == null) { return(null); } Transform itemView = AvailableItemListView.Instantiate(Prefab, parent) as Transform; return(itemView); }
public Transform CreateItem(Transform parent) { if (Prefab == null) { return(null); } Transform itemView = AvailableItemListView.Instantiate(Prefab, parent) as Transform; itemView.GetComponent <Text>().text = ""; return(itemView); }