private Vector2 GetChatHeight(object data) { ScrollLayout referScrollLayout = scrollSystem.GetOriginPrefab("Chat").GetComponent <ScrollLayout>(); var height = referScrollLayout.GetHeightByStr((data as ChatData).msg); return(new Vector2(-1, height)); }