| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.Linq; |
| | 4 | | using UnityEngine; |
| | 5 | | using UnityEngine.UI; |
| | 6 | | using static UnityEngine.UI.GridLayoutGroup; |
| | 7 | |
|
| | 8 | | public interface IGridContainerComponentView |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// Number of items per row that fit with the current grid configuration. |
| | 12 | | /// </summary> |
| | 13 | | int currentItemsPerRow { get; } |
| | 14 | |
|
| | 15 | | /// <summary> |
| | 16 | | /// Set the type of constraint of the grid. |
| | 17 | | /// </summary> |
| | 18 | | /// <param name="newConstraint">Type of constraint.</param> |
| | 19 | | void SetConstraint(Constraint newConstraint); |
| | 20 | |
|
| | 21 | | /// <summary> |
| | 22 | | /// Set the number of columns/rows of the grid depending on the type of constraint set. |
| | 23 | | /// </summary> |
| | 24 | | /// <param name="newConstraintCount">Number of columns or rows.</param> |
| | 25 | | void SetConstraintCount(int newConstraintCount); |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// Set the item size adaptation to the container. |
| | 29 | | /// </summary> |
| | 30 | | /// <param name="adaptItemSizeToContainer">True for activate the size adaptation.</param> |
| | 31 | | void SetItemSizeToContainerAdaptation(bool adaptItemSizeToContainer); |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Set the size of each child item. |
| | 35 | | /// </summary> |
| | 36 | | /// <param name="newItemSize">Size of each child.</param> |
| | 37 | | void SetItemSize(Vector2 newItemSize); |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Set the space between child items. |
| | 41 | | /// </summary> |
| | 42 | | /// <param name="newSpace">Space between children.</param> |
| | 43 | | void SetSpaceBetweenItems(Vector2 newSpace); |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Set the minimum width for the items when constraint is set to flexible. |
| | 47 | | /// </summary> |
| | 48 | | /// <param name="minWidthForFlexibleItems">Min item width.</param> |
| | 49 | | void SetMinWidthForFlexibleItems(float minWidthForFlexibleItems); |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// Creates the items of the grid from the prefab. All previously existing items will be removed. |
| | 53 | | /// </summary> |
| | 54 | | /// <param name="prefab">Prefab to create items</param> |
| | 55 | | /// <param name="amountOfItems">Amounts of items to be created</param> |
| | 56 | | void SetItems(BaseComponentView prefab, int amountOfItems); |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// Set the items of the grid. All previously existing items will be removed. |
| | 60 | | /// </summary> |
| | 61 | | /// <param name="items">List of UI components.</param> |
| | 62 | | void SetItems(List<BaseComponentView> items); |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// Adds a new item in the grid. |
| | 66 | | /// </summary> |
| | 67 | | /// <param name="item">An UI component.</param> |
| | 68 | | void AddItem(BaseComponentView item); |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Remove an item from the grid. |
| | 72 | | /// </summary> |
| | 73 | | /// <param name="item">An UI component</param> |
| | 74 | | void RemoveItem(BaseComponentView item); |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Get all the items of the grid. |
| | 78 | | /// </summary> |
| | 79 | | /// <returns>List of items.</returns> |
| | 80 | | List<BaseComponentView> GetItems(); |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Extract all items out of the grid. |
| | 84 | | /// </summary> |
| | 85 | | /// <returns>The list of extracted items.</returns> |
| | 86 | | List<BaseComponentView> ExtractItems(); |
| | 87 | |
|
| | 88 | | /// <summary> |
| | 89 | | /// Remove all existing items from the grid. |
| | 90 | | /// </summary> |
| | 91 | | void RemoveItems(); |
| | 92 | | } |
| | 93 | |
|
| | 94 | | public class GridContainerComponentView : BaseComponentView, IGridContainerComponentView, IComponentModelConfig |
| | 95 | | { |
| | 96 | | [Header("Prefab References")] |
| | 97 | | [SerializeField] internal GridLayoutGroup gridLayoutGroup; |
| | 98 | | [SerializeField] internal RectTransform externalParentToAdaptSize; |
| | 99 | |
|
| | 100 | | [Header("Configuration")] |
| | 101 | | [SerializeField] internal GridContainerComponentModel model; |
| | 102 | |
|
| 865 | 103 | | internal List<BaseComponentView> instantiatedItems = new List<BaseComponentView>(); |
| | 104 | |
|
| 0 | 105 | | public int currentItemsPerRow { get; internal set; } |
| | 106 | |
|
| | 107 | | public override void Awake() |
| | 108 | | { |
| 317 | 109 | | base.Awake(); |
| | 110 | |
|
| 317 | 111 | | RegisterCurrentInstantiatedItems(); |
| 317 | 112 | | } |
| | 113 | |
|
| | 114 | | public void Configure(BaseComponentModel newModel) |
| | 115 | | { |
| 3 | 116 | | model = (GridContainerComponentModel)newModel; |
| 3 | 117 | | RefreshControl(); |
| 3 | 118 | | } |
| | 119 | |
|
| | 120 | | public override void RefreshControl() |
| | 121 | | { |
| 4 | 122 | | if (model == null) |
| 0 | 123 | | return; |
| | 124 | |
|
| | 125 | | //We only do this if we don't have items, this is done because the editor doesn't call awake method |
| 4 | 126 | | if (instantiatedItems.Count == 0) |
| 2 | 127 | | RegisterCurrentInstantiatedItems(); |
| | 128 | |
|
| 4 | 129 | | SetConstraint(model.constraint); |
| 4 | 130 | | SetItemSize(model.itemSize); |
| 4 | 131 | | SetConstraintCount(model.constraintCount); |
| 4 | 132 | | SetSpaceBetweenItems(model.spaceBetweenItems); |
| 4 | 133 | | } |
| | 134 | |
|
| | 135 | | public override void OnScreenSizeChanged() |
| | 136 | | { |
| 1 | 137 | | base.OnScreenSizeChanged(); |
| | 138 | |
|
| 1 | 139 | | SetItemSize(model.itemSize); |
| 1 | 140 | | SetConstraintCount(model.constraintCount); |
| 1 | 141 | | } |
| | 142 | |
|
| | 143 | | public override void Dispose() |
| | 144 | | { |
| 903 | 145 | | base.Dispose(); |
| | 146 | |
|
| 903 | 147 | | RemoveItems(); |
| 903 | 148 | | } |
| | 149 | |
|
| | 150 | | public void SetConstraint(Constraint newConstraint) |
| | 151 | | { |
| 7 | 152 | | model.constraint = newConstraint; |
| | 153 | |
|
| 7 | 154 | | if (gridLayoutGroup == null) |
| 0 | 155 | | return; |
| | 156 | |
|
| 7 | 157 | | gridLayoutGroup.constraint = newConstraint; |
| 7 | 158 | | } |
| | 159 | |
|
| | 160 | | public void SetConstraintCount(int newConstraintCount) |
| | 161 | | { |
| 325 | 162 | | model.constraintCount = newConstraintCount; |
| | 163 | |
|
| 325 | 164 | | if (gridLayoutGroup == null) |
| 0 | 165 | | return; |
| | 166 | |
|
| 325 | 167 | | gridLayoutGroup.constraintCount = newConstraintCount; |
| 325 | 168 | | } |
| | 169 | |
|
| | 170 | | public void SetItemSizeToContainerAdaptation(bool adaptItemSizeToContainer) |
| | 171 | | { |
| 1 | 172 | | model.adaptHorizontallyItemSizeToContainer = adaptItemSizeToContainer; |
| 1 | 173 | | SetItemSize(model.itemSize); |
| 1 | 174 | | } |
| | 175 | |
|
| | 176 | | public void SetItemSize(Vector2 newItemSize) |
| | 177 | | { |
| 371 | 178 | | Vector2 newSizeToApply = newItemSize; |
| | 179 | |
|
| 371 | 180 | | if (model.adaptVerticallyItemSizeToContainer && model.adaptHorizontallyItemSizeToContainer) |
| | 181 | | { |
| 10 | 182 | | CalculateAutoSize(out newSizeToApply); |
| 10 | 183 | | } |
| 361 | 184 | | else if (model.adaptVerticallyItemSizeToContainer) |
| | 185 | | { |
| | 186 | | //TODO: We need to implement this functionality. Nobody is using it |
| | 187 | | // Please implement it if needed |
| 0 | 188 | | throw new Exception("Not implemented yet! Please implement the functionality"); |
| | 189 | | } |
| 361 | 190 | | else if (model.adaptHorizontallyItemSizeToContainer) |
| | 191 | | { |
| 161 | 192 | | switch (model.constraint) |
| | 193 | | { |
| | 194 | | case Constraint.FixedColumnCount: |
| 159 | 195 | | CalculateHorizontalSizeForFixedColumnConstraint(out newSizeToApply); |
| 159 | 196 | | break; |
| | 197 | | case Constraint.FixedRowCount: |
| 1 | 198 | | CalculateHorizontalSizeForFixedRowConstraint(out newSizeToApply); |
| 1 | 199 | | break; |
| | 200 | | case Constraint.Flexible: |
| 1 | 201 | | CalculateHorizontalSizeForFlexibleConstraint(out newSizeToApply, newItemSize); |
| 1 | 202 | | break; |
| | 203 | | } |
| | 204 | | } |
| | 205 | | else |
| | 206 | | { |
| 200 | 207 | | switch (model.constraint) |
| | 208 | | { |
| | 209 | | case Constraint.FixedColumnCount: |
| | 210 | | case Constraint.Flexible: |
| 33 | 211 | | currentItemsPerRow = model.constraintCount; |
| 33 | 212 | | break; |
| | 213 | | case Constraint.FixedRowCount: |
| 167 | 214 | | currentItemsPerRow = (int)Mathf.Ceil((float)instantiatedItems.Count / model.constraintCount); |
| | 215 | | break; |
| | 216 | | } |
| | 217 | | } |
| | 218 | |
|
| 371 | 219 | | model.itemSize = newSizeToApply; |
| | 220 | |
|
| 371 | 221 | | if (gridLayoutGroup == null) |
| 0 | 222 | | return; |
| | 223 | |
|
| 371 | 224 | | gridLayoutGroup.cellSize = newSizeToApply; |
| | 225 | |
|
| 371 | 226 | | ResizeGridContainer(); |
| 371 | 227 | | } |
| | 228 | |
|
| | 229 | | internal void CalculateAutoSize(out Vector2 newSizeToApply) |
| | 230 | | { |
| 10 | 231 | | float height = externalParentToAdaptSize != null ? externalParentToAdaptSize.rect.height : ((RectTransform)trans |
| 10 | 232 | | float width = externalParentToAdaptSize != null ? externalParentToAdaptSize.rect.width : ((RectTransform)transfo |
| | 233 | |
|
| 10 | 234 | | int amountsOfHorizontalItemsPerRow = instantiatedItems.Count / model.constraintCount; |
| 10 | 235 | | int amountsOfVerticalItemsPerColumn = instantiatedItems.Count / amountsOfHorizontalItemsPerRow; |
| | 236 | |
|
| 10 | 237 | | float extraSpaceToRemoveX = model.spaceBetweenItems.x * (amountsOfHorizontalItemsPerRow - 1); |
| 10 | 238 | | float extraSpaceToRemoveY = model.spaceBetweenItems.y * (amountsOfVerticalItemsPerColumn - 1); |
| | 239 | |
|
| 10 | 240 | | float itemWidth = model.recommendedWidthForFlexibleItems; |
| 10 | 241 | | float itemHeight = model.recommendedHeightForFlexibleItems; |
| | 242 | |
|
| 10 | 243 | | if (itemWidth * amountsOfHorizontalItemsPerRow + extraSpaceToRemoveX >= width) |
| 0 | 244 | | itemWidth = width / amountsOfHorizontalItemsPerRow - extraSpaceToRemoveX; |
| | 245 | |
|
| 10 | 246 | | if (itemWidth < model.minWidthForFlexibleItems) |
| 0 | 247 | | itemWidth = model.minWidthForFlexibleItems; |
| | 248 | |
|
| 10 | 249 | | if (itemHeight * amountsOfVerticalItemsPerColumn + extraSpaceToRemoveY >= height) |
| 0 | 250 | | itemHeight = height / amountsOfVerticalItemsPerColumn - extraSpaceToRemoveY; |
| | 251 | |
|
| 10 | 252 | | if (itemHeight < model.minHeightForFlexibleItems) |
| 0 | 253 | | itemHeight = model.minHeightForFlexibleItems; |
| | 254 | |
|
| 10 | 255 | | if (model.sameHeightAndWidhtFlexibleItem) |
| | 256 | | { |
| 10 | 257 | | float minValue = Mathf.Min(itemHeight, itemWidth); |
| 10 | 258 | | itemHeight = minValue; |
| 10 | 259 | | itemWidth = minValue; |
| | 260 | | } |
| | 261 | |
|
| 10 | 262 | | newSizeToApply = new Vector2( |
| | 263 | | itemWidth, |
| | 264 | | itemHeight); |
| | 265 | |
|
| 10 | 266 | | currentItemsPerRow = model.constraintCount; |
| 10 | 267 | | } |
| | 268 | |
|
| | 269 | | internal void CalculateHorizontalSizeForFixedColumnConstraint(out Vector2 newSizeToApply) |
| | 270 | | { |
| 159 | 271 | | float width = externalParentToAdaptSize != null ? externalParentToAdaptSize.rect.width : ((RectTransform)transfo |
| 159 | 272 | | float extraSpaceToRemove = (model.spaceBetweenItems.x * (model.constraintCount - 1)) / model.constraintCount; |
| | 273 | |
|
| 159 | 274 | | newSizeToApply = new Vector2( |
| | 275 | | (width / model.constraintCount) - extraSpaceToRemove, |
| | 276 | | model.itemSize.y); |
| | 277 | |
|
| 159 | 278 | | currentItemsPerRow = model.constraintCount; |
| 159 | 279 | | } |
| | 280 | |
|
| | 281 | | internal void CalculateHorizontalSizeForFixedRowConstraint(out Vector2 newSizeToApply) |
| | 282 | | { |
| 1 | 283 | | float height = ((RectTransform)transform).rect.height; |
| 1 | 284 | | float extraSpaceToRemove = (model.spaceBetweenItems.y / (model.constraintCount / 2f)); |
| | 285 | |
|
| 1 | 286 | | newSizeToApply = new Vector2( |
| | 287 | | model.itemSize.x, |
| | 288 | | (height / model.constraintCount) - extraSpaceToRemove); |
| | 289 | |
|
| 1 | 290 | | currentItemsPerRow = (int)Mathf.Ceil((float)instantiatedItems.Count / model.constraintCount); |
| 1 | 291 | | } |
| | 292 | |
|
| | 293 | | internal void CalculateHorizontalSizeForFlexibleConstraint(out Vector2 newSizeToApply, Vector2 newItemSize) |
| | 294 | | { |
| 1 | 295 | | newSizeToApply = newItemSize; |
| | 296 | |
|
| 1 | 297 | | float width = externalParentToAdaptSize != null ? externalParentToAdaptSize.rect.width : ((RectTransform)transfo |
| 1 | 298 | | int numberOfPossibleItems = (int)(width / model.minWidthForFlexibleItems); |
| | 299 | |
|
| 1 | 300 | | SetConstraint(Constraint.FixedColumnCount); |
| | 301 | |
|
| 1 | 302 | | if (numberOfPossibleItems > 0) |
| | 303 | | { |
| 0 | 304 | | for (int numColumnsToTry = 1; numColumnsToTry <= numberOfPossibleItems; numColumnsToTry++) |
| | 305 | | { |
| 0 | 306 | | SetConstraintCount(numColumnsToTry); |
| 0 | 307 | | SetItemSize(model.itemSize); |
| 0 | 308 | | currentItemsPerRow = numColumnsToTry; |
| | 309 | |
|
| 0 | 310 | | if (model.itemSize.x < model.minWidthForFlexibleItems) |
| | 311 | | { |
| 0 | 312 | | SetConstraintCount(numColumnsToTry - 1); |
| 0 | 313 | | SetItemSize(model.itemSize); |
| 0 | 314 | | currentItemsPerRow = numColumnsToTry - 1; |
| 0 | 315 | | break; |
| | 316 | | } |
| | 317 | |
|
| 0 | 318 | | newSizeToApply = model.itemSize; |
| | 319 | | } |
| 0 | 320 | | } |
| | 321 | | else |
| | 322 | | { |
| 1 | 323 | | newSizeToApply = new Vector2(model.minWidthForFlexibleItems, newSizeToApply.y); |
| | 324 | | } |
| | 325 | |
|
| 1 | 326 | | SetConstraint(Constraint.Flexible); |
| 1 | 327 | | } |
| | 328 | |
|
| | 329 | | public void SetSpaceBetweenItems(Vector2 newSpace) |
| | 330 | | { |
| 163 | 331 | | model.spaceBetweenItems = newSpace; |
| | 332 | |
|
| 163 | 333 | | if (gridLayoutGroup == null) |
| 0 | 334 | | return; |
| | 335 | |
|
| 163 | 336 | | gridLayoutGroup.spacing = newSpace; |
| 163 | 337 | | } |
| | 338 | |
|
| | 339 | | public void SetMinWidthForFlexibleItems(float minWidthForFlexibleItems) |
| | 340 | | { |
| 1 | 341 | | model.minWidthForFlexibleItems = minWidthForFlexibleItems; |
| 1 | 342 | | SetItemSize(model.itemSize); |
| 1 | 343 | | } |
| | 344 | |
|
| | 345 | | public void SetItems(BaseComponentView prefab, int amountOfItems) |
| | 346 | | { |
| 2 | 347 | | RemoveItems(); |
| | 348 | |
|
| 20 | 349 | | for (int i = 0; i < amountOfItems; i++) |
| | 350 | | { |
| 8 | 351 | | BaseComponentView instanciatedItem = Instantiate(prefab); |
| 8 | 352 | | CreateItem(instanciatedItem, $"Item{i}"); |
| | 353 | | } |
| | 354 | |
|
| 2 | 355 | | SetItemSize(model.itemSize); |
| 2 | 356 | | } |
| | 357 | |
|
| | 358 | | public void SetItems(List<BaseComponentView> items) |
| | 359 | | { |
| 12 | 360 | | RemoveItems(); |
| | 361 | |
|
| 74 | 362 | | for (int i = 0; i < items.Count; i++) |
| | 363 | | { |
| 25 | 364 | | CreateItem(items[i], $"Item{i}"); |
| | 365 | | } |
| | 366 | |
|
| 12 | 367 | | SetItemSize(model.itemSize); |
| 12 | 368 | | } |
| | 369 | |
|
| | 370 | | public void AddItem(BaseComponentView item) |
| | 371 | | { |
| 21 | 372 | | CreateItem(item, $"Item{instantiatedItems.Count}"); |
| 21 | 373 | | SetItemSize(model.itemSize); |
| 21 | 374 | | } |
| | 375 | |
|
| | 376 | | public void RemoveItem(BaseComponentView item) |
| | 377 | | { |
| 8 | 378 | | BaseComponentView itemToRemove = instantiatedItems.FirstOrDefault(x => x == item); |
| 4 | 379 | | if (itemToRemove != null) |
| | 380 | | { |
| 4 | 381 | | Destroy(itemToRemove.gameObject); |
| 4 | 382 | | instantiatedItems.Remove(item); |
| | 383 | | } |
| | 384 | |
|
| 4 | 385 | | SetItemSize(model.itemSize); |
| 4 | 386 | | } |
| | 387 | |
|
| 0 | 388 | | public List<BaseComponentView> GetItems() { return instantiatedItems; } |
| | 389 | |
|
| | 390 | | public List<BaseComponentView> ExtractItems() |
| | 391 | | { |
| 1313 | 392 | | List<BaseComponentView> extractedItems = new List<BaseComponentView>(); |
| 2998 | 393 | | foreach (BaseComponentView item in instantiatedItems) |
| | 394 | | { |
| 186 | 395 | | if (item != null) |
| 181 | 396 | | item.transform.SetParent(null); |
| | 397 | |
|
| 186 | 398 | | extractedItems.Add(item); |
| | 399 | | } |
| | 400 | |
|
| 1313 | 401 | | instantiatedItems.Clear(); |
| | 402 | |
|
| 1313 | 403 | | return extractedItems; |
| | 404 | | } |
| | 405 | |
|
| | 406 | | public void RemoveItems() |
| | 407 | | { |
| 1197 | 408 | | List<BaseComponentView> itemsToDestroy = ExtractItems(); |
| 2726 | 409 | | foreach (BaseComponentView itemToDestroy in itemsToDestroy) |
| | 410 | | { |
| 166 | 411 | | if (itemToDestroy != null) |
| 161 | 412 | | DestroyImmediate(itemToDestroy.gameObject); |
| | 413 | | } |
| 1197 | 414 | | itemsToDestroy.Clear(); |
| | 415 | |
|
| 1197 | 416 | | instantiatedItems.Clear(); |
| 1197 | 417 | | } |
| | 418 | |
|
| | 419 | | internal void CreateItem(BaseComponentView newItem, string name) |
| | 420 | | { |
| 55 | 421 | | if (newItem == null) |
| 0 | 422 | | return; |
| | 423 | |
|
| 55 | 424 | | newItem.transform.SetParent(transform); |
| 55 | 425 | | newItem.transform.localPosition = Vector3.zero; |
| 55 | 426 | | newItem.transform.localScale = Vector3.one; |
| 55 | 427 | | newItem.name = name; |
| | 428 | |
|
| 55 | 429 | | instantiatedItems.Add(newItem); |
| 55 | 430 | | } |
| | 431 | |
|
| | 432 | | internal void ResizeGridContainer() |
| | 433 | | { |
| 371 | 434 | | int currentNumberOfItems = transform.childCount; |
| | 435 | |
|
| 371 | 436 | | if (currentNumberOfItems == 0) |
| | 437 | | { |
| 213 | 438 | | ((RectTransform)transform).sizeDelta = Vector2.zero; |
| 213 | 439 | | return; |
| | 440 | | } |
| | 441 | |
|
| 158 | 442 | | if (model.constraint == Constraint.FixedColumnCount) |
| | 443 | | { |
| 140 | 444 | | int numRows = (int)Mathf.Ceil((float)currentNumberOfItems / model.constraintCount); |
| 140 | 445 | | ((RectTransform)transform).sizeDelta = new Vector2( |
| | 446 | | model.adaptHorizontallyItemSizeToContainer ? ((RectTransform)transform).sizeDelta.x : (model.constraintC |
| | 447 | | (numRows * model.itemSize.y) + (model.spaceBetweenItems.y * (numRows - 1))); |
| 140 | 448 | | } |
| 18 | 449 | | else if (model.constraint == Constraint.FixedRowCount) |
| | 450 | | { |
| 18 | 451 | | int numCols = (int)Mathf.Ceil((float)currentNumberOfItems / model.constraintCount); |
| 18 | 452 | | ((RectTransform)transform).sizeDelta = new Vector2( |
| | 453 | | (numCols * model.itemSize.x) + (model.spaceBetweenItems.x * (numCols - 1)), |
| | 454 | | model.adaptHorizontallyItemSizeToContainer ? ((RectTransform)transform).sizeDelta.y : (model.constraintC |
| | 455 | | } |
| | 456 | |
|
| 158 | 457 | | SetSpaceBetweenItems(model.spaceBetweenItems); |
| 158 | 458 | | } |
| | 459 | |
|
| | 460 | | internal void RegisterCurrentInstantiatedItems() |
| | 461 | | { |
| 319 | 462 | | instantiatedItems.Clear(); |
| | 463 | |
|
| 908 | 464 | | foreach (Transform child in transform) |
| | 465 | | { |
| 135 | 466 | | BaseComponentView existingItem = child.GetComponent<BaseComponentView>(); |
| 135 | 467 | | if (existingItem != null) |
| 135 | 468 | | instantiatedItems.Add(existingItem); |
| | 469 | | else |
| 0 | 470 | | DestroyImmediate(child.gameObject); |
| | 471 | | } |
| | 472 | |
|
| 319 | 473 | | SetItemSize(model.itemSize); |
| 319 | 474 | | SetConstraintCount(model.constraintCount); |
| 319 | 475 | | } |
| | 476 | | } |