ui搭建完成
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user