替换玩家模型素材,添加 ChildrenMap 配置挂点
This commit is contained in:
+16
-1
@@ -27,6 +27,7 @@ namespace SepCore.UI
|
||||
View.infoText.text = _context.Description;
|
||||
View.textFormatText.Set(_context.Price);
|
||||
View.recycleButton.gameObject.SetActive(_context.ShowRecycleButton);
|
||||
View.combineButton.gameObject.SetActive(_context.ShowCombineButton);
|
||||
View.iconArea.SetRarity(_context.Rarity);
|
||||
|
||||
ResizeToFitContent();
|
||||
@@ -54,6 +55,14 @@ namespace SepCore.UI
|
||||
}
|
||||
}
|
||||
|
||||
public void OnCombineButtonClick()
|
||||
{
|
||||
if (_context != null)
|
||||
{
|
||||
GameEntry.Event.Fire(this, ItemTooltipCombineEventArgs.Create(_context.Index));
|
||||
}
|
||||
}
|
||||
|
||||
public void OnCancelButtonClick()
|
||||
{
|
||||
GameEntry.Event.Fire(this, ItemTooltipHideEventArgs.Create());
|
||||
@@ -68,6 +77,7 @@ namespace SepCore.UI
|
||||
|
||||
_listenersBound = true;
|
||||
View.recycleButton.onClick.AddListener(OnRecycleButtonClick);
|
||||
View.combineButton.onClick.AddListener(OnCombineButtonClick);
|
||||
View.cancelButton.onClick.AddListener(OnCancelButtonClick);
|
||||
}
|
||||
|
||||
@@ -83,7 +93,12 @@ namespace SepCore.UI
|
||||
descriptionSize.y = View.infoText.preferredHeight;
|
||||
View.infoText.rectTransform.sizeDelta = descriptionSize;
|
||||
float descriptionHeight = Mathf.Max(0f, View.infoText.preferredHeight);
|
||||
float targetHeight = _fixedTopHeight + descriptionHeight + _fixedBottomHeight;
|
||||
float bottomHeight = _fixedBottomHeight;
|
||||
if (_context != null && _context.ShowCombineButton)
|
||||
{
|
||||
bottomHeight += 100f;
|
||||
}
|
||||
float targetHeight = _fixedTopHeight + descriptionHeight + bottomHeight;
|
||||
|
||||
Vector2 size = new Vector2(_fixedWidth, targetHeight);
|
||||
View.contentRectTransform.sizeDelta = size;
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace SepCore.UI
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI typeText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI infoText;
|
||||
[SerializeField] public global::SepCore.UI.CommonButton recycleButton;
|
||||
[SerializeField] public global::SepCore.UI.CommonButton combineButton;
|
||||
[SerializeField] public global::SepCore.UI.FormatTextUI textFormatText;
|
||||
[SerializeField] public global::SepCore.UI.CommonButton cancelButton;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user