| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using UnityEngine;
- namespace AdaptUI
- {
- [Serializable]
- public class UILayoutData
- {
- public int paddingLeft;
- public int paddingRight;
- public int paddingTop;
- public int paddingBottom;
- public float spacing;
- public TextAnchor childAlignment;
- public bool reverseArrangement;
- public bool controlChildWidth;
- public bool controlChildHeight;
- public bool useChildScaleWidth;
- public bool useChildScaleHeight;
- public bool childForceExpandWidth;
- public bool childForceExpandHeight;
- // ✅ 默认构造函数(必须)
- public UILayoutData() { }
- // ✅ 解决编译错误,添加拷贝构造函数
- public UILayoutData(UILayoutData layout)
- {
- this.paddingLeft = layout.paddingLeft;
- this.paddingRight = layout.paddingRight;
- this.paddingTop = layout.paddingTop;
- this.paddingBottom = layout.paddingBottom;
- this.spacing = layout.spacing;
- this.childAlignment = layout.childAlignment;
- this.reverseArrangement = layout.reverseArrangement;
- this.controlChildWidth = layout.controlChildWidth;
- this.controlChildHeight = layout.controlChildHeight;
- this.useChildScaleWidth = layout.useChildScaleWidth;
- this.useChildScaleHeight = layout.useChildScaleHeight;
- this.childForceExpandWidth = layout.childForceExpandWidth;
- this.childForceExpandHeight = layout.childForceExpandHeight;
- }
- }
- }
|