示例#1
0
 private void Awake()
 {
     stageViewPrefab    = LoadResourceController.GetCampaignStageView();
     playerCampaign     = DataPlayer.GetModule <PlayerCampaign>();
     campaignCollection = LoadResourceController.GetCampaignConfigCollection();
     mapConfig          = campaignCollection.GetMapCampaignConfigWithStageId(playerCampaign.GetLastStagePass());
 }
示例#2
0
    public EnhancedScrollerCellView GetCellView(EnhancedScroller scroller, int dataIndex, int cellIndex)
    {
        // first, we get a cell from the scroller by passing a prefab.
        // if the scroller finds one it can recycle it will do so, otherwise
        // it will create a new cell.
        CampaignStageView cellView = scroller.GetCellView(stageViewPrefab) as CampaignStageView;

        // set the name of the game object to the cell's data index.
        // this is optional, but it helps up debug the objects in
        // the scene hierarchy.
        cellView.name = "Cell " + dataIndex.ToString();

        // in this example, we just pass the data to our cell's view which will update its UI
        cellView.SetData(_data[dataIndex]);

        // return the cell to the scroller
        return(cellView);
    }