Skip to content
Snippets Groups Projects
ScrollListWindowInitializer.cs 388 B
Newer Older
  • Learn to ignore specific revisions
  • using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class ScrollListWindowInitializer : MonoBehaviour
    {
        void OnEnable()
        {
            var layoutElem = GetComponent<UnityEngine.UI.LayoutElement>();
            var parentRectTranform = transform.parent.GetComponent<RectTransform>();
            layoutElem.minHeight = parentRectTranform.rect.height;
        }
    }