21 lines
566 B
C#
21 lines
566 B
C#
using SuperScrollView;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ReplyItem : MonoBehaviour
|
|
{
|
|
public Text mMsgText;
|
|
public Image mItemBg;
|
|
public void SetItemData(string str)
|
|
{
|
|
mMsgText.text = str;
|
|
}
|
|
private void Update()
|
|
{
|
|
Vector2 size = mItemBg.GetComponent<RectTransform>().sizeDelta;
|
|
size.x = mMsgText.GetComponent<RectTransform>().sizeDelta.x + 20;
|
|
size.y = mMsgText.GetComponent<RectTransform>().sizeDelta.y + 35;
|
|
mItemBg.GetComponent<RectTransform>().sizeDelta = size;
|
|
}
|
|
}
|