示例#1
0
        /// <inheritdoc/>
        protected override void UpdateViewsHolder(CellGroupViewsHolder <MyCellViewsHolder> newOrRecycled)
        {
            base.UpdateViewsHolder(newOrRecycled);

            // This is a Row prefab. We're updating it as a header if it's the special kind of row (the empty row separating our categories)
            if (newOrRecycled.NumActiveCells > 0)
            {
                var firstCellVH         = newOrRecycled.ContainingCellViewsHolders[0];
                int modelIndex          = firstCellVH.ItemIndex;
                var model               = Data[modelIndex];
                var newOrRecycledCasted = newOrRecycled as MyCellGroupViewsHolder;
                if (model.type == CellModel.CellType.IN_ROW_SEPARATING_CATEGORIES)
                {
                    newOrRecycledCasted.ShowHeader(model.parentCategory.name);
                }
                else
                {
                    newOrRecycledCasted.ClearHeader();
                }
            }

            // Constantly triggering a twin pass after the current normal pass, so the CSFs will be updated
            // This can be optimized by keeping track of what items already had their size calculated, but for our purposes it's enough
            ScheduleComputeVisibilityTwinPass();
        }
示例#2
0
        /// <inheritdoc/>
        protected override void UpdateViewsHolder(CellGroupViewsHolder <MyCellViewsHolder> newOrRecycled)
        {
            base.UpdateViewsHolder(newOrRecycled);

            // Constantly triggering a twin pass after the current normal pass, so the CSFs will be updated
            ScheduleComputeVisibilityTwinPass();
        }
示例#3
0
        protected override void OnCellViewsHolderCreated(MyCellViewsHolder cellVH, CellGroupViewsHolder <MyCellViewsHolder> cellGroup)
        {
            base.OnCellViewsHolderCreated(cellVH, cellGroup);

            // Set listeners for the Toggle in each cell. Will call OnCellToggled() when the toggled state changes
            // Set this adapter as listener for the OnItemLongClicked event
            cellVH.toggle.onValueChanged.AddListener(_ => OnCellToggled(cellVH));
            cellVH.longClickableComponent.longClickListener = this;
            cellVH.expandCollapseComponent.useUnscaledTime  = _Params.UseUnscaledTime;
        }
 protected override void OnCellViewsHolderCreated(CreatureGridItemViewsHolder cellVh,
                                                  CellGroupViewsHolder <CreatureGridItemViewsHolder> cellGroup)
 {
     base.OnCellViewsHolderCreated(cellVh, cellGroup);
     cellVh.button.onClick.AddListener(() => { Debug.Log("clicked: " + cellVh.ItemIndex); });
 }
示例#5
0
        ///// </inheritdoc>
        //protected override void OnCellViewsHolderCreated(MyCellViewsHolder cellVH, CellGroupViewsHolder<MyCellViewsHolder> cellGroup)
        //{
        //	base.OnCellViewsHolderCreated(cellVH, cellGroup);

        //	cellVH.flexibleHeightToggle.onValueChanged.AddListener(_ => OnFlexibleHeightToggledOnCell(cellVH));
        //}

        /// </inheritdoc>
        protected override void OnCellViewsHolderCreated(MyCellViewsHolder cellVH, CellGroupViewsHolder <MyCellViewsHolder> cellGroup)
        {
            base.OnCellViewsHolderCreated(cellVH, cellGroup);

            cellVH.iconRemoteImageBehaviour.InitializeWithPool(_ImagesPool);
        }