ui搭建完成

This commit is contained in:
2026-05-14 21:25:42 +08:00
parent 5ec09c2ad3
commit d2235bf7b7
13 changed files with 12675 additions and 9161 deletions

View File

@@ -11,7 +11,7 @@ namespace Unity.RenderStreaming
{
public class MessageChannel : DataChannelBase
{
public event Action<string, UserInfo> OnMessageReceived;
public event Action<string, UserInfo> OnUserInfoMessageReceived;
public event Action<string, MediaStateChange> OnMediaStateChangeReceived;
[Header("消息记录")] [SerializeField, TextArea(1, 3)]
@@ -41,7 +41,8 @@ namespace Unity.RenderStreaming
{
record = new MessageRecord { type = "raw", data = message };
}
record.timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
ConnectionId=record.connectionId;
JObject json = null;
switch (record.type)
{
@@ -51,7 +52,7 @@ namespace Unity.RenderStreaming
case MessageTypes.UserInfo:
json = record.data as JObject;
var info = json.ToObject<UserInfo>();
OnMessageReceived?.Invoke(ConnectionId, info);
OnUserInfoMessageReceived?.Invoke(ConnectionId, info);
break;
case MessageTypes.MediaStateChange:
json = record.data as JObject;
@@ -112,6 +113,8 @@ namespace Unity.RenderStreaming
public object data;
public bool isSent;
public string timestamp = DateTime.Now.ToString();
public string connectionId;
public string participantId;
}
}
}