DGJ преди 1 година
родител
ревизия
f6608651de

+ 0 - 259
Assets/Game/Blue/RTC/Mono/GHZRTCManager.cs

@@ -1,259 +0,0 @@
-using Blue;
-using GHZRtc;
-using LitJson;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using UnityEngine;
-using UnityEngine.UI;
-
-
-/// <summary>
-/// 重新写的
-/// </summary>
-public class GHZRTCManager : SingletonMono<GHZRTCManager>, IController
-{
-    /// <summary>
-    /// 自身UID
-    /// </summary>
-    private string uid;
-    /// <summary>
-    /// 当前频道号
-    /// </summary>
-    private string channelName;
-
-    public string UID
-    {
-        get => uid;
-        set
-        {
-            if (value != null)
-                this.uid = value;
-        }
-    }
-
-    public string ChannelName
-    {
-        get => channelName;
-        set
-        {
-            if (value != null)
-                this.channelName = value;
-        }
-    }
-
-    /// <summary>
-    /// 初始化
-    /// </summary>
-    public void Init()
-    {
-        Debug.LogError("Init");
-        GHZRtcManager.Instance.Init();
-    }
-
-    public string RoomID;
-    public void JoinTest()
-    {
-        EndustryLoginUserInfo sendLogin = new EndustryLoginUserInfo()
-        {
-            account = "cy2",
-            password = "1"
-        };
-        string jsonLogin = JsonMapper.ToJson(sendLogin);
-        HttpTool.Instance.PostLogin("https://api-fat1.ghz-tech.com" + HttpActionLang.login, jsonLogin, mes =>
-        {
-            JObject obj = JObject.Parse(mes);
-            if (obj["code"].ToString() == "200")
-            {
-                if (!string.IsNullOrWhiteSpace(obj["data"].ToString()) && !string.IsNullOrWhiteSpace(obj["data"]["token"].ToString()))
-                {
-                    login.UserInfo.Instance.Token = obj["data"]["token"].ToString();
-
-                    JsonData data = new JsonData();
-                    data["roomId"] = RoomID;
-                    StartCoroutine(HttpTool.Instance.SendHttp("https://api-fat1.ghz-tech.com" + HttpActionLang.rtc_JoinRoom, data.ToJson(), message =>
-                    {
-                        JObject jobject = JObject.Parse(message);
-                        if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
-                        {
-                            Debug.LogError($"加入房间:{jobject["data"].ToString()}");
-                            RTCRoomInfo mRTCRoomInfo = JsonConvert.DeserializeObject<RTCRoomInfo>(jobject["data"].ToString());
-                            Debug.LogError($"加入房间成功,房间ID:{mRTCRoomInfo.roomId}");
-                            Debug.LogError($"地址链接:https://{mRTCRoomInfo.host}");
-                            Debug.LogError($"Token:{mRTCRoomInfo.token}");
-                            GHZRtcManager.Instance.ConnectRoom(mRTCRoomInfo.host, mRTCRoomInfo.token);
-                        }
-                    }));
-                }
-            }
-        });
-    }
-
-    /// <summary>
-    ///  进入房间
-    /// </summary>
-    public void JoinChannel(string url, string token)
-    {
-        GHZRtcManager.Instance.ConnectRoom(url, token, false);
-    }
-
-    /// <summary>
-    ///  退出房间
-    /// </summary>
-    public void LeaveChannel()
-    {
-        GHZRtcManager.Instance.DisconnectRoom();
-    }
-
-    /// <summary>
-    ///  显示用户画面
-    /// </summary>
-    /// <param name="uid"> 用户的UID</param>
-    /// <param name="rawImage"> 需要显示的RawImage</param>
-    public void ShowViewRawImage(string uid, RawImage rawImage)
-    {
-        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
-        {
-            if (i.sid == uid)
-            {
-                rawImage.texture = GHZRtcManager.Instance.remoteParticipantViews[i].VideoView;
-            }
-        }
-
-        //  var localVideoViewARF = (AspectRatioFitter)localVideoView.GetComponent<AspectRatioFitter>();
-        //  localVideoViewARF.aspectRatio = (float)videoTrack.Texture.width / videoTrack.Texture.height;
-    }
-    /// <summary>
-    ///  显示用户画面
-    /// </summary>
-    /// <param name="uid"> 用户的UID</param>
-    /// <param name="mesh"> 需要显示的Mesh</param>
-    public void ShowViewMeshRenderer(string uid, MeshRenderer mesh)
-    {
-        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
-        {
-            if (i.sid == uid)
-            {
-                mesh.material.mainTexture = GHZRtcManager.Instance.remoteParticipantViews[i].VideoView;
-            }
-        }
-
-    }
-
-    /// <summary>
-    ///  开关自身音频
-    /// </summary>
-    /// <param name="isAudio"></param>
-    public void MuteLocalAudioStream(bool isAudio)
-    {
-        GHZRtcManager.Instance.OnMicrophone(isAudio);
-    }
-    /// <summary>
-    ///  开关自身视频
-    /// </summary>
-    /// <param name="isVideo"></param>
-    public void MuteLocalVideoStream(bool isVideo)
-    {
-        GHZRtcManager.Instance.OnWebCam(isVideo);
-    }
-    /// <summary>
-    ///  订阅/取订 用户音频
-    /// </summary>
-    /// <param name="uid"></param>
-    /// <param name="isAudio"></param>
-    public void MuteRemoteAudioStream(string uid, bool isAudio)
-    {
-
-        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
-        {
-            if (i.sid == uid)
-            {
-                if (i.audioTracks.Count > 0)
-                {
-                    for (int j = 0; j < i.audioTracks.Count; j++)
-                    {
-                        string sid = i.audioTracks[j].sid;
-                        i.Room.engine.signalClient.SendMuteTrack(sid, !isAudio);
-
-                    }
-
-                }
-            }
-        }
-    }
-
-    /// <summary>
-    ///  订阅/取订 用户视频
-    /// </summary>
-    /// <param name="uid"></param>
-    /// <param name="isVideo"></param>
-    public void MuteRemoteVideoStream(string uid, bool isVideo)
-    {
-
-        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
-        {
-            if (i.sid == uid)
-            {
-                if (i.videoTracks.Count > 0)
-                {
-                    for (int j = 0; j < i.videoTracks.Count; j++)
-                    {
-                        string sid = i.videoTracks[j].sid;
-                        i.Room.engine.signalClient.SendMuteTrack(sid, !isVideo);
-
-                    }
-
-                }
-            }
-        }
-
-    }
-    public delegate void OnRemoteAudioStateChangedEvent(string uid, REMOTE_AUIDO_STATE_REASON_RTC state);
-    public static OnRemoteAudioStateChangedEvent OnRemoteAudioStateChanged;
-    /// <summary>
-    /// 用户音频状态发生变化的回调
-    /// </summary>
-    /// <param name="uid"></param>
-    /// <param name="state"> 音频状态 </param>
-    public void RemoteAudioStateChanged(string uid, REMOTE_AUIDO_STATE_REASON_RTC state)
-    {
-        Debug.Log("uid=RemoteAudioStateChanged=>" + state);
-        OnRemoteAudioStateChanged?.Invoke(uid, state);
-    }
-    public delegate void OnRemoteVideoStateChangedEvent(string uid, REMOTE_VIDEO_STATE_REASON_RTC state);
-    public static OnRemoteVideoStateChangedEvent OnRemoteVideoStateChanged;
-    /// <summary>
-    /// 用户视频状态发生变化的回调
-    /// </summary>
-    /// <param name="uid"></param>
-    /// <param name="state"> 视频状态 </param>
-    public void RemoteVideoStateChanged(string uid, REMOTE_VIDEO_STATE_REASON_RTC state)
-    {
-        Debug.Log("uid=RemoteVideoStateChanged=>" + state);
-        OnRemoteVideoStateChanged?.Invoke(uid, state);
-    }
-
-    public delegate void OnUserJoinedEvent(string uid);
-    public static OnUserJoinedEvent OnUserJoined;
-    /// <summary>
-    ///  有用户进入频道的回调
-    /// </summary>
-    /// <param name="uid"></param>
-    public void UserJoined(string uid)
-    {
-        Debug.Log("uid=UserJoined=>" + uid);
-        OnUserJoined?.Invoke(uid);
-    }
-
-    public delegate void OnUserOfflineEvent(string uid);
-    public static OnUserOfflineEvent OnUserOffline;
-    /// <summary>
-    ///  有用户退出频道的回调
-    /// </summary>
-    /// <param name="uid"></param>
-    public void UserOffline(string uid)
-    {
-        Debug.Log("uid=UserOffline=>" + uid);
-        OnUserOffline?.Invoke(uid);
-
-    }
-}

+ 11 - 11
Assets/Game/ShowSupport/ShowRtc.prefab

@@ -146,7 +146,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: a43b8a9800829334c9c189d88cd35465, type: 3}
+  m_Sprite: {fileID: 21300000, guid: e49baf1ce366699449aab9bcda3267ff, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -930,9 +930,9 @@ RectTransform:
   m_Father: {fileID: 372168226550290580}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 1034.8295, y: -420}
   m_SizeDelta: {x: 1600, y: 144}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &2467664462275900261
@@ -1519,9 +1519,9 @@ RectTransform:
   m_Father: {fileID: 372168226550290580}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 1034.8295, y: -246}
   m_SizeDelta: {x: 1600, y: 144}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &2792716997211558038
@@ -2022,7 +2022,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: a43b8a9800829334c9c189d88cd35465, type: 3}
+  m_Sprite: {fileID: 21300000, guid: e49baf1ce366699449aab9bcda3267ff, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1
@@ -2592,9 +2592,9 @@ RectTransform:
   m_Father: {fileID: 372168226550290580}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 1034.8295, y: -72}
   m_SizeDelta: {x: 1600, y: 144}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &1586159309132858650

+ 3 - 3
Assets/LangChaoRTC/Remote/ShowRoom/RoomFile.prefab

@@ -555,7 +555,7 @@ MonoBehaviour:
     m_Top: 5
     m_Bottom: 0
   m_ChildAlignment: 0
-  m_Spacing: 4
+  m_Spacing: 20
   m_ChildForceExpandWidth: 1
   m_ChildForceExpandHeight: 1
   m_ChildControlWidth: 0
@@ -1573,7 +1573,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 5295285540247215454, guid: a5c61b9b0b4aa184cbc1f6ef6eb326fe, type: 3}
       propertyPath: m_AnchoredPosition.x
-      value: 0
+      value: 138.455
       objectReference: {fileID: 0}
     - target: {fileID: 5295285540247215454, guid: a5c61b9b0b4aa184cbc1f6ef6eb326fe, type: 3}
       propertyPath: m_AnchoredPosition.y
@@ -1649,7 +1649,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 5295285540490895475, guid: a5c61b9b0b4aa184cbc1f6ef6eb326fe, type: 3}
       propertyPath: m_AnchoredPosition.x
-      value: 0
+      value: 5
       objectReference: {fileID: 0}
     - target: {fileID: 5295285540490895475, guid: a5c61b9b0b4aa184cbc1f6ef6eb326fe, type: 3}
       propertyPath: m_AnchoredPosition.y

+ 12 - 12
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Prefab/MsgItem.prefab

@@ -37,7 +37,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
   m_AnchoredPosition: {x: 20, y: -20}
-  m_SizeDelta: {x: 787.5, y: 0}
+  m_SizeDelta: {x: 717.4, y: 0}
   m_Pivot: {x: 0, y: 1}
 --- !u!222 &5295285539923751739
 CanvasRenderer:
@@ -211,7 +211,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 138.455, y: 0}
   m_SizeDelta: {x: 254.91, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5295285540247215458
@@ -265,9 +265,9 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   m_Padding:
-    m_Left: 134
+    m_Left: 112
     m_Right: 0
-    m_Top: 0
+    m_Top: -20
     m_Bottom: 0
   m_ChildAlignment: 0
   m_Spacing: 5
@@ -385,13 +385,13 @@ MonoBehaviour:
   m_faceColor:
     serializedVersion: 2
     rgba: 4294967295
-  m_fontSize: 35
-  m_fontSizeBase: 35
+  m_fontSize: 30
+  m_fontSizeBase: 30
   m_fontWeight: 400
   m_enableAutoSizing: 0
   m_fontSizeMin: 18
   m_fontSizeMax: 72
-  m_fontStyle: 0
+  m_fontStyle: 1
   m_HorizontalAlignment: 1
   m_VerticalAlignment: 256
   m_textAlignment: 65535
@@ -457,7 +457,7 @@ RectTransform:
   m_GameObject: {fileID: 5295285540490895468}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: -0.00018146387}
-  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_LocalScale: {x: 1.2, y: 1.2, z: 1.2}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 5295285540205387260}
@@ -537,10 +537,10 @@ MonoBehaviour:
   m_Padding:
     m_Left: 11
     m_Right: 0
-    m_Top: -16
+    m_Top: 0
     m_Bottom: 0
   m_ChildAlignment: 0
-  m_Spacing: -20
+  m_Spacing: 0
   m_ChildForceExpandWidth: 1
   m_ChildForceExpandHeight: 1
   m_ChildControlWidth: 0
@@ -609,8 +609,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 537.75, y: 0}
-  m_SizeDelta: {x: 807.5, y: 47}
+  m_AnchoredPosition: {x: 480.7, y: 20}
+  m_SizeDelta: {x: 737.4, y: 47}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!222 &5295285541080847998
 CanvasRenderer:

+ 7 - 7
Assets/LangChaoRTC/Remote/ShowRoom/RoomMain.prefab

@@ -27,7 +27,7 @@ RectTransform:
   m_GameObject: {fileID: 315786544407291327}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_LocalScale: {x: 1.5, y: 1.5, z: 1.5}
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 6496188556605830589}
@@ -35,8 +35,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: 0, y: -6.920001}
-  m_SizeDelta: {x: 11.151, y: 4.588}
+  m_AnchoredPosition: {x: -0.00000011921, y: -6.92}
+  m_SizeDelta: {x: 17.83, y: 10}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &1514232037865815622
 CanvasRenderer:
@@ -93,8 +93,8 @@ MonoBehaviour:
   m_faceColor:
     serializedVersion: 2
     rgba: 4294967295
-  m_fontSize: 2
-  m_fontSizeBase: 2
+  m_fontSize: 2.5
+  m_fontSizeBase: 2.5
   m_fontWeight: 400
   m_enableAutoSizing: 0
   m_fontSizeMin: 18
@@ -938,7 +938,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: -4.5, y: -36}
+  m_AnchoredPosition: {x: -4.5, y: -38}
   m_SizeDelta: {x: 7.2, y: 7.2}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &2241088650822641919
@@ -3670,7 +3670,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Sprite: {fileID: 21300000, guid: 0e12054b405f9e84eb5b4621c81f4efa, type: 3}
+  m_Sprite: {fileID: 21300000, guid: e49baf1ce366699449aab9bcda3267ff, type: 3}
   m_Type: 0
   m_PreserveAspect: 0
   m_FillCenter: 1

+ 117 - 0
Assets/Scripts/RTC/GHZRTCFusionManager.cs

@@ -0,0 +1,117 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class GHZRTCFusionManager : MonoSingleton<GHZRTCFusionManager>
+{
+    /// <summary>
+    ///  创建房间
+    /// </summary>
+   public void CreateRoom()
+    {
+        GHZRTCManager.Instance.CreateRoom();
+    }
+    /// <summary>
+    /// 加入房间 
+    /// </summary>
+    /// <param name="roomId"></param>
+    public void JoinedRoom( string roomId)
+    {
+        GHZRTCManager.Instance.JoinedRoom(roomId);
+    }
+    /// <summary>
+    ///  退出房间
+    /// </summary>
+    public void LeaveRoom()
+    {
+        GHZRTCManager.Instance.LeaveRoom();
+    }
+    /// <summary>
+    /// 本地音频流开关
+    /// </summary>
+    /// <param name="state">True 开  False 关 </param>
+    public void MuteLocalAudioStream(bool state)
+    {
+        GHZRTCManager.Instance.MuteLocalAudioStream(state);
+    }
+    /// <summary>
+    ///  本地视频流开关
+    /// </summary>
+    /// <param name="state">True 开  False 关 </param>
+    public void MuteLocalVideoStream(bool state)
+    {
+        GHZRTCManager.Instance.MuteLocalVideoStream(state);
+    }
+    /// <summary>
+    /// 远端用户音频管理
+    /// </summary>
+    /// <param name="state"></param>
+    /// <param name="uid"></param>
+    public void MuteRemoteAudioStream(bool state, string uid = null)
+    {
+        GHZRTCManager.Instance.MuteRemoteAudioStream(state, uid);
+    }
+    /// <summary>
+    /// 远端用户视频管理
+    /// </summary>
+    /// <param name="state"></param>
+    /// <param name="uid"></param>
+    public void MuteRemoteVideoStream(bool state, string uid = null)
+    {
+        GHZRTCManager.Instance.MuteRemoteVideoStream(state, uid);
+    }
+    /// <summary>
+    ///  设置远端用户显示画面
+    /// </summary>
+    /// <param name="mesh"> 需要显示的 MeshRenderer </param>
+    /// <param name="uid"> 远端用户Uid </param>
+    public void SetVideoFrame(MeshRenderer mesh,string uid = null)
+    {
+        GHZRTCManager.Instance.SetVideoFrame(mesh, uid);
+    }
+    /// <summary>
+    ///  设置远端用户显示画面
+    /// </summary>
+    /// <param name="mesh"> 需要显示的 RawImage </param>
+    /// <param name="uid"> 远端用户Uid </param>
+    public void SetVideoFrame(RawImage rawImage,string uid =null )
+    {
+        GHZRTCManager.Instance.SetVideoFrame(rawImage, uid);
+    }
+    /// <summary>
+    ///  远端用户音频流状态回调
+    /// </summary>
+    /// <param name="uid"> 远端用户Uid </param>
+    /// <param name="state"> 音频流状态 </param>
+    public void RemoteAudioStateChanged(string uid, REMOTE_AUIDO_STATE_REASON_RTC state)
+    {
+
+    }
+    /// <summary>
+    ///  远端用户视频流状态回调
+    /// </summary>
+    /// <param name="uid"> 远端用户Uid </param>
+    /// <param name="state"> 视频流状态 </param>
+    public void RemoteVideoStateChanged(string uid, REMOTE_VIDEO_STATE_REASON_RTC state)
+    {
+
+    }
+    /// <summary>
+    ///  用户进入房间回调
+    /// </summary>
+    /// <param name="uid"></param>
+    public void UserJoined(string uid)
+    {
+
+    }
+    /// <summary>
+    /// 用户离开房间回调
+    /// </summary>
+    /// <param name="uid"></param>
+    public void UserOffline(string uid)
+    {
+
+    }
+    
+}

+ 11 - 0
Assets/Scripts/RTC/GHZRTCFusionManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4aa34162c6c2b1c44a4af390a8a0afa9
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 165 - 0
Assets/Scripts/RTC/GHZRTCManager.cs

@@ -0,0 +1,165 @@
+using LitJson;
+using Newtonsoft.Json.Linq;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class GHZRTCManager : MonoSingleton<GHZRTCManager>
+{
+    private void Start()
+    {
+        RTCManager.OnRemoteAudioStateChanged += RemoteAudioStateChanged;
+        RTCManager.OnRemoteVideoStateChanged += RemoteVideoStateChanged;
+        RTCManager.OnUserJoined += UserJoined;
+        RTCManager.OnUserOffline += UserOffline;
+    }
+
+    private void OnDisable()
+    {
+        RTCManager.OnRemoteAudioStateChanged -= RemoteAudioStateChanged;
+        RTCManager.OnRemoteVideoStateChanged -= RemoteVideoStateChanged;
+        RTCManager.OnUserJoined -= UserJoined;
+        RTCManager.OnUserOffline -= UserOffline;
+    }
+
+    public void CreateRoom()
+    {
+        StartCoroutine(
+            HttpTool.Instance.SendHttp(HttpActionLang.rtc_CreateRoom, "", message =>
+            {
+                JObject jobject = JObject.Parse(message);
+                if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
+                {
+                    string host = jobject["data"]["host"].ToString();
+                    string token = jobject["data"]["token"].ToString();
+                    string roomId = jobject["data"]["roomId"].ToString();
+                    GHZRtcManager.Instance.ConnectRoom("https://" + host, token);
+                }
+            }, "application/x-www-form-urlencoded"));
+    }
+
+    public void JoinedRoom( string roomId)
+    {
+        JsonData data = new JsonData();
+        data["roomId"] = roomId;
+        StartCoroutine(
+            HttpTool.Instance.SendHttp(HttpActionLang.rtc_JoinRoom, data.ToJson(), message =>
+            {
+                JObject jobject = JObject.Parse(message);
+                if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
+                {
+                    string host = jobject["data"]["host"].ToString();
+                    string token = jobject["data"]["token"].ToString();
+                    string roomId = jobject["data"]["roomId"].ToString();
+                    GHZRtcManager.Instance.ConnectRoom("https://" + host, token);
+                }
+            }));
+
+    }
+
+    public void LeaveRoom()
+    {
+        GHZRtcManager.Instance.DisconnectRoom();
+    }
+
+    public void MuteLocalAudioStream(bool state)
+    {
+        GHZRtcManager.Instance.OnMicrophone(state);
+    }
+
+    public void MuteLocalVideoStream(bool state)
+    {
+        GHZRtcManager.Instance.OnWebCam(state);
+    }
+
+    public void MuteRemoteAudioStream(bool state,string uid = null)
+    {
+
+        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
+        {
+            if (i.sid == uid)
+            {
+                if (i.audioTracks.Count > 0)
+                {
+                    for (int j = 0; j < i.audioTracks.Count; j++)
+                    {
+                        string sid = i.audioTracks[j].sid;
+                        i.Room.engine.signalClient.SendMuteTrack(sid, !state);
+
+                    }
+
+                }
+            }
+        }
+    }
+
+    public void MuteRemoteVideoStream(bool state, string uid = null)
+    {
+
+        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
+        {
+            if (i.sid == uid)
+            {
+                if (i.videoTracks.Count > 0)
+                {
+                    for (int j = 0; j < i.videoTracks.Count; j++)
+                    {
+                        string sid = i.videoTracks[j].sid;
+                        i.Room.engine.signalClient.SendMuteTrack(sid, !state);
+
+                    }
+
+                }
+            }
+        }
+    }
+
+    public void SetVideoFrame(MeshRenderer mesh, string uid = null)
+    {
+        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
+        {
+            if (i.sid == uid)
+            {
+                mesh.material.mainTexture = GHZRtcManager.Instance.remoteParticipantViews[i].VideoView;
+                RTCRoomManager.Instance.expertView = GHZRtcManager.Instance.remoteParticipantViews[i];
+            }
+        }
+    }
+
+    public void SetVideoFrame(RawImage rawImage, string uid = null)
+    {
+        foreach (var i in GHZRtcManager.Instance.remoteParticipantViews.Keys)
+        {
+            Debug.Log("DGJ ===> SID " + i.sid + "    " + uid);
+            if (i.sid == uid)
+            {
+                Debug.Log("DGJ ===> ShowViewRawImage");
+                rawImage.texture = GHZRtcManager.Instance.remoteParticipantViews[i].VideoView;
+                RTCRoomManager.Instance.expertView = GHZRtcManager.Instance.remoteParticipantViews[i];
+            }
+        }
+    }
+
+    public void RemoteAudioStateChanged(string uid, REMOTE_AUIDO_STATE_REASON_RTC state)
+    {
+        GHZRTCFusionManager.Instance.RemoteAudioStateChanged(uid, state);
+    }
+
+    public void RemoteVideoStateChanged(string uid, REMOTE_VIDEO_STATE_REASON_RTC state)
+    {
+        GHZRTCFusionManager.Instance.RemoteVideoStateChanged(uid, state);
+    }
+
+    public void UserJoined(string uid)
+    {
+        GHZRTCFusionManager.Instance.UserJoined(uid);
+    }
+
+    public void UserOffline(string uid)
+    {
+        GHZRTCFusionManager.Instance.UserOffline(uid);
+    }
+
+
+}

+ 1 - 1
Assets/Game/Blue/RTC/Mono/GHZRTCManager.cs.meta → Assets/Scripts/RTC/GHZRTCManager.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: b79c2934bbb08ca47a57a97f00089cb7
+guid: ef6b39ac22ec6c8419e19c4bdc03895e
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 1 - 1
Packages/manifest.json

@@ -15,7 +15,7 @@
     "com.unity.timeline": "1.6.4",
     "com.unity.ugui": "1.0.0",
     "com.unity.visualscripting": "1.7.8",
-    "com.unity.webrtc": "3.0.0-pre.7",
+    "com.unity.webrtc": "3.0.0-pre.1",
     "com.unity.xr.arcore": "4.2.8",
     "com.unity.xr.arfoundation": "4.2.8",
     "com.unity.xr.openxr": "1.5.3",

+ 1 - 1
Packages/packages-lock.json

@@ -150,7 +150,7 @@
       "url": "https://packages.unity.cn"
     },
     "com.unity.webrtc": {
-      "version": "3.0.0-pre.7",
+      "version": "3.0.0-pre.1",
       "depth": 0,
       "source": "registry",
       "dependencies": {