public string GetUnityLimitedMessage() { var message = this.message; const int MAX_LENGTH = System.UInt16.MaxValue / 4 - 1; //From unity source if (message.Length > MAX_LENGTH) { message = message.Substring(0, MAX_LENGTH); } return message; }