|
@@ -713,6 +713,7 @@ namespace MetaClient
|
|
|
{
|
|
|
CreateColFun(parentid, _objPar,colItem);
|
|
|
}
|
|
|
+ GridLayoutGroupChange(_objPar);
|
|
|
DRCustomFace[] dRCustomBodies = _facedata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
@@ -759,6 +760,7 @@ namespace MetaClient
|
|
|
CreateColFun(parentid, _objPar, colItem);
|
|
|
|
|
|
}
|
|
|
+ GridLayoutGroupChange(_objPar);
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
@@ -804,6 +806,7 @@ namespace MetaClient
|
|
|
// CreateColFun(parentid, _objPar, colItem);
|
|
|
|
|
|
//}
|
|
|
+ GridLayoutGroupChange(_objPar);
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
@@ -819,6 +822,7 @@ namespace MetaClient
|
|
|
{
|
|
|
GameObject _obj = GameObject.Instantiate(_clone);
|
|
|
_obj.transform.SetParent(_objPar.transform);
|
|
|
+ _obj.transform.localScale = new Vector3(1, 1, 1);
|
|
|
UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
|
|
|
}
|
|
@@ -826,6 +830,7 @@ namespace MetaClient
|
|
|
{
|
|
|
GameObject _obj = GameObject.Instantiate(_clone);
|
|
|
_obj.transform.SetParent(_objPar.transform);
|
|
|
+ _obj.transform.localScale = new Vector3(1, 1, 1);
|
|
|
UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
|
|
|
nowChooseColorObj = _obj;
|
|
@@ -878,10 +883,11 @@ namespace MetaClient
|
|
|
{
|
|
|
CreateColFun(parentid, _objPar, colItem);
|
|
|
}
|
|
|
+ GridLayoutGroupChange(_objPar);
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
|
- Debug.Log(dRCustomBodies[i].Id);
|
|
|
+ //Debug.Log(dRCustomBodies[i].Id);
|
|
|
if (dRCustomBodies[i].ParentStyple == parentid && dRCustomBodies[i].Cengji == cengji)
|
|
|
{
|
|
|
CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body, dRCustomBodies[i].IsActive);
|
|
@@ -889,7 +895,18 @@ namespace MetaClient
|
|
|
}
|
|
|
ChangeListBotton(_objPar);
|
|
|
}
|
|
|
-
|
|
|
+ private void GridLayoutGroupChange(GameObject _objPar)
|
|
|
+ {
|
|
|
+
|
|
|
+ GridLayoutGroup gridLayoutGroup = _objPar.GetComponent<GridLayoutGroup>();
|
|
|
+ RectTransform _objParRect = _objPar.GetComponent<RectTransform>();
|
|
|
+ LayoutRebuilder.ForceRebuildLayoutImmediate(_objParRect);
|
|
|
+ //float _x = _objParRect.rect.width;
|
|
|
+ //gridLayoutGroup.cellSize = new Vector2(_x, _x / 100 * 144);
|
|
|
+ gridLayoutGroup.spacing = new Vector2(0, 0);
|
|
|
+ Debug.Log(gridLayoutGroup.spacing.y);
|
|
|
+ LayoutRebuilder.ForceRebuildLayoutImmediate(_objParRect);
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 改变列表长短
|
|
@@ -991,13 +1008,21 @@ namespace MetaClient
|
|
|
Image _objImg = _obj.transform.GetComponent<Image>();
|
|
|
_obj.SetActive(true);
|
|
|
_objImg.sprite = sprite;
|
|
|
+ //_objImg.SetNativeSize();
|
|
|
+
|
|
|
_obj.name = _name+"";
|
|
|
_obj.transform.SetParent(_parent.transform);
|
|
|
+ _obj.transform.localScale = new Vector3(1, 1, 1);
|
|
|
if (_isactive != 1)
|
|
|
{
|
|
|
_obj.SetActive(false);
|
|
|
}
|
|
|
-
|
|
|
+ //RectTransform rect = _parent.GetComponent<RectTransform>();
|
|
|
+ //LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
|
|
|
+ //Vector3 vecScale = rect.localScale;
|
|
|
+ //float width = rect.rect.width;
|
|
|
+ //float height = rect.rect.height;
|
|
|
+ //LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
|
|
|
UICustomBtn uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
uICustomBtn.id = _id;
|
|
|
uICustomBtn.eButtonStyple = (EButtonStyple)buttonstyple;
|