对话框调整
This commit is contained in:
@@ -43,13 +43,15 @@ namespace AibisDream
|
||||
idx = data.idx;
|
||||
maxWidth = data.maxWidth;
|
||||
minWidth = data.minWidth;
|
||||
transform.position = data.slotPosition;
|
||||
var rect = transform as RectTransform;
|
||||
rect.localPosition = UIManager.GetDialogUIPos(data.slotPosition);
|
||||
// 设置style
|
||||
SetStyle(data.bubbleStyle, data.pivotType);
|
||||
}
|
||||
|
||||
private void SetStyle(BubbleStyle bubbleStyle, PivotType pivotType)
|
||||
{
|
||||
_bubbleImage.color = bubbleStyle.imageColor;
|
||||
// padding内容
|
||||
_layoutGroup.padding = bubbleStyle.BubblePadding;
|
||||
_lineText.margin = bubbleStyle.linePadding;
|
||||
@@ -61,7 +63,10 @@ namespace AibisDream
|
||||
|
||||
// 锚点相关
|
||||
_rect.pivot = CommonUtil.GetPivotByType(pivotType);
|
||||
var spritePath = $"{bubbleStyle.bubbleSpriteAddress}[{pivotType.ToString()}]";
|
||||
var spritePath = bubbleStyle.bubbleSpriteAddress.EndsWith("]")
|
||||
? $"{bubbleStyle.bubbleSpriteAddress}"
|
||||
: $"{bubbleStyle.bubbleSpriteAddress}[{pivotType.ToString()}]";
|
||||
|
||||
_bubbleImage.sprite = ResourceKit.LoadAssetSync<Sprite>(spritePath);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace AibisDream
|
||||
|
||||
public void LoadData(BubbleOptionSlotData data)
|
||||
{
|
||||
transform.position = data.slotPosition;
|
||||
((RectTransform)transform).localPosition = UIManager.GetDialogUIPos(data.slotPosition);
|
||||
}
|
||||
|
||||
public void ShowOption(DialogOption dialogOption)
|
||||
|
||||
Reference in New Issue
Block a user