using UnityEngine; namespace Wizard; public class ChatLogPartsNotice : MonoBehaviour { private const int PADDING_NOTICE_MESSAGE_AND_FRAME = 42; [SerializeField] private UILabel _labelEndNotice; [SerializeField] private UILabel _labelShareNotice; public void SetText(string text, bool isEnd) { _labelEndNotice.gameObject.SetActive(isEnd); _labelShareNotice.gameObject.SetActive(!isEnd); if (isEnd) { _labelEndNotice.text = text; } else { _labelShareNotice.text = text; } } public Vector2 GetSize(string text, bool isEnd) { UILabel uILabel = _labelShareNotice; if (isEnd) { uILabel = _labelEndNotice; } string text2 = uILabel.text; uILabel.InitializeFont(); uILabel.text = text; uILabel.ProcessText(); int num = 42 + uILabel.width; int height = uILabel.height; uILabel.text = text2; return new Vector2(num, height); } }