DGJ 1 year ago
parent
commit
b3a27e1651

+ 3 - 1
Assets/Game/ShowSupport/SupportControl.cs

@@ -113,13 +113,15 @@ public class SupportControl : AbstractController
         // 否则直接创建
         switch (RTCRoomManager.Instance.rtcState)
         {
-            case RTCEnum.OFF:              
+            case RTCEnum.OFF:
+                RTCRoomManager.Instance.isApply = true;
                 this.GetService<IRTCService>().CreatRoom();
                 break;
             case RTCEnum.Online:
             case RTCEnum.ExpertOnline:
             case RTCEnum.ConterlOnline:
             case RTCEnum.ALLOnline:
+                RTCRoomManager.Instance.isApply = true;
                 RTCRoomManager.Instance.OnLocalUserJoined();
                 break;
             default:

+ 97 - 0
Assets/ParticipantView.prefab

@@ -234,6 +234,7 @@ GameObject:
   - component: {fileID: 1032180714776240068}
   - component: {fileID: 75636858011709399}
   - component: {fileID: -1029172090264722488}
+  - component: {fileID: -1544837558781065563}
   m_Layer: 5
   m_Name: ParticipantView
   m_TagString: Untagged
@@ -316,6 +317,102 @@ MonoBehaviour:
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_PixelsPerUnitMultiplier: 1
+--- !u!82 &-1544837558781065563
+AudioSource:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1032180714776240065}
+  m_Enabled: 1
+  serializedVersion: 4
+  OutputAudioMixerGroup: {fileID: 0}
+  m_audioClip: {fileID: 0}
+  m_PlayOnAwake: 1
+  m_Volume: 1
+  m_Pitch: 1
+  Loop: 0
+  Mute: 0
+  Spatialize: 0
+  SpatializePostEffects: 0
+  Priority: 128
+  DopplerLevel: 1
+  MinDistance: 1
+  MaxDistance: 500
+  Pan2D: 0
+  rolloffMode: 0
+  BypassEffects: 0
+  BypassListenerEffects: 0
+  BypassReverbZones: 0
+  rolloffCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 3
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+      weightedMode: 0
+      inWeight: 0.33333334
+      outWeight: 0.33333334
+    - serializedVersion: 3
+      time: 1
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+      weightedMode: 0
+      inWeight: 0.33333334
+      outWeight: 0.33333334
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  panLevelCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 3
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+      weightedMode: 0
+      inWeight: 0.33333334
+      outWeight: 0.33333334
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  spreadCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 3
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+      weightedMode: 0
+      inWeight: 0.33333334
+      outWeight: 0.33333334
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  reverbZoneMixCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 3
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+      weightedMode: 0
+      inWeight: 0.33333334
+      outWeight: 0.33333334
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
 --- !u!1 &2831058422319912165
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 9
Assets/Scenes/LangChaoDemo2.unity

@@ -15594,6 +15594,7 @@ MonoBehaviour:
   dis: 0
   angle: 0
   pos: {x: 0, y: 0, z: 0}
+  state: 1
 --- !u!1 &1107507333
 GameObject:
   m_ObjectHideFlags: 0
@@ -24795,7 +24796,6 @@ GameObject:
   m_Component:
   - component: {fileID: 1868885244}
   - component: {fileID: 1868885246}
-  - component: {fileID: 1868885245}
   m_Layer: 0
   m_Name: Camera
   m_TagString: Untagged
@@ -24818,14 +24818,6 @@ Transform:
   m_Father: {fileID: 1975066677}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!81 &1868885245
-AudioListener:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1868885243}
-  m_Enabled: 1
 --- !u!20 &1868885246
 Camera:
   m_ObjectHideFlags: 0
@@ -28499,6 +28491,8 @@ MonoBehaviour:
   rtcState: 0
   controlPhone: 
   isRTCreate: 0
+  audio1: {fileID: 0}
+  audio2: {fileID: 0}
 --- !u!114 &973110132107938483
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 1 - 0
Assets/Scripts/MQTT/MQTTManager.cs

@@ -188,6 +188,7 @@ public class MQTTManager : MonoSingleton<MQTTManager>,IController
                     {
                         //string roomid = obj["rtcRoom"].ToString();                       
                         //string resourcePool = obj["control"]["resourcePoo1"].ToString();
+                        RTCRoomManager.Instance.isInvite = true;
                         UICallManager.Instance.EventInvite(obj["control"].ToString(), "");
                         Debug.Log(phone);
                     }

+ 1 - 1
Assets/Scripts/RTC/OnWebSocketMsg.cs

@@ -21,7 +21,7 @@ public class OnWebSocketMsg : MonoSingleton<OnWebSocketMsg>
 
     public void OnWebSocketMessage(SignalResponse response)
     {
-        Debug.Log("DGJ  ===> OnWebSocketMessage " + response);
+        Debug.Log("DGJ  ===++> OnWebSocketMessage " + response);
         switch (response.MessageCase)
         {
             case SignalResponse.MessageOneofCase.None:

+ 29 - 15
Assets/Scripts/RTC/RTCRoomManager.cs

@@ -30,6 +30,15 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
     public GameObject audio2;
 
     public Dictionary<string, AudioSource> dicAudio;
+
+    /// <summary>
+    /// 是否邀请中控
+    /// </summary>
+    public bool isInvite = false;
+    /// <summary>
+    /// 是否申请协助
+    /// </summary>
+    public bool isApply = false;
     private void Start()
     {
         this.RegisterEvent<RTCCreatRoomSuccessEvent>(CreatRoomSuccess).UnRegisterWhenGameObjectDestroyed(gameObject);
@@ -89,9 +98,27 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
     public void OnLocalUserJoined()
     {
        // UserJoined(UserEnum.Player);
+
+        if(isInvite) // 邀请中控
+        {
+            isInvite = false;
+            JsonData obj = new JsonData();
+            obj["action"] = "invite";
+            obj["rtcRoom"] = mRTCRoomInfo.roomId.ToString();
+            obj["personnel"] = new JsonData();
+            obj["personnel"]["id"] = MQTTManager.Instance.id;
+            obj["personnel"]["name"] = MQTTManager.Instance._username;
+            obj["personnel"]["resourcePoo1"] = MQTTManager.Instance.resourcePool;
+            obj["personnel"]["room"] = MQTTManager.Instance.room;
+            obj["personnel"]["phone"] = MQTTManager.Instance.phone;
+            // 用MQTT 向中考发送邀请
+            MQTTManager.Instance.PushMsg(MQTTManager.Instance.front + "online/" + controlPhone, obj.ToJson());
+
+        }
       
-        if (ScenesManager.Instance.getWindow()== ScenesManager.SceneType.ShowRTC) // 当前在RTC 频道内
+        if (isApply) // 当前在RTC 频道内
         {
+            isApply = false;
             JsonData data = new JsonData();
             data["roomId"] = mRTCRoomInfo.roomId.ToString();
             data["questionCategory"] = (int)question;
@@ -110,20 +137,7 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
                 }
             }));
         }
-        else
-        {
-            JsonData obj = new JsonData();
-            obj["action"] = "invite";
-            obj["rtcRoom"] = mRTCRoomInfo.roomId.ToString();
-            obj["personnel"] = new JsonData();
-            obj["personnel"]["id"] = MQTTManager.Instance.id;
-            obj["personnel"]["name"] = MQTTManager.Instance._username;
-            obj["personnel"]["resourcePoo1"] = MQTTManager.Instance.resourcePool;
-            obj["personnel"]["room"] = MQTTManager.Instance.room;
-            obj["personnel"]["phone"] = MQTTManager.Instance.phone;
-            // 用MQTT 向中考发送邀请
-            MQTTManager.Instance.PushMsg(MQTTManager.Instance.front +"online/"+controlPhone, obj.ToJson());
-        }
+       
 
        
 

+ 52 - 43
ProjectSettings/ProjectSettings.asset

@@ -13,7 +13,7 @@ PlayerSettings:
   useOnDemandResources: 0
   accelerometerFrequency: 60
   companyName: XR
-  productName: LangChao
+  productName: "\u667A\u80FD\u5DE1\u68C0Demo"
   defaultCursor: {fileID: 0}
   cursorHotspot: {x: 0, y: 0}
   m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
@@ -146,9 +146,7 @@ PlayerSettings:
     16:9: 1
     Others: 1
   bundleVersion: 1.0.0
-  preloadedAssets:
-  - {fileID: -3507145773158424512, guid: 3df6047a2585e9a4b87f07c19a70fec7, type: 2}
-  - {fileID: -6724271008176559649, guid: aba1d4d6205d4914784889e2d8ed78c4, type: 2}
+  preloadedAssets: []
   metroInputSource: 0
   wsaTransparentSwapchain: 0
   m_HolographicPauseOnTrackingLoss: 1
@@ -168,12 +166,12 @@ PlayerSettings:
   androidSupportedAspectRatio: 1
   androidMaxAspectRatio: 2.1
   applicationIdentifier:
-    Android: com.XR.LangChao
+    Android: com.XR.XJDemo
   buildNumber:
     Standalone: 0
     iPhone: 0
     tvOS: 0
-  overrideDefaultApplicationIdentifier: 0
+  overrideDefaultApplicationIdentifier: 1
   AndroidBundleVersionCode: 1
   AndroidMinSdkVersion: 26
   AndroidTargetSdkVersion: 0
@@ -286,36 +284,6 @@ PlayerSettings:
   m_BuildTargetPlatformIcons:
   - m_BuildTarget: Android
     m_Icons:
-    - m_Textures: []
-      m_Width: 432
-      m_Height: 432
-      m_Kind: 2
-      m_SubKind: 
-    - m_Textures: []
-      m_Width: 324
-      m_Height: 324
-      m_Kind: 2
-      m_SubKind: 
-    - m_Textures: []
-      m_Width: 216
-      m_Height: 216
-      m_Kind: 2
-      m_SubKind: 
-    - m_Textures: []
-      m_Width: 162
-      m_Height: 162
-      m_Kind: 2
-      m_SubKind: 
-    - m_Textures: []
-      m_Width: 108
-      m_Height: 108
-      m_Kind: 2
-      m_SubKind: 
-    - m_Textures: []
-      m_Width: 81
-      m_Height: 81
-      m_Kind: 2
-      m_SubKind: 
     - m_Textures: []
       m_Width: 192
       m_Height: 192
@@ -326,7 +294,8 @@ PlayerSettings:
       m_Height: 144
       m_Kind: 1
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 2800000, guid: 6d84c7ff90ad32643b3b1824e6ca6c99, type: 3}
       m_Width: 96
       m_Height: 96
       m_Kind: 1
@@ -346,36 +315,76 @@ PlayerSettings:
       m_Height: 36
       m_Kind: 1
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 0}
       m_Width: 192
       m_Height: 192
       m_Kind: 0
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 0}
       m_Width: 144
       m_Height: 144
       m_Kind: 0
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 2800000, guid: 6d84c7ff90ad32643b3b1824e6ca6c99, type: 3}
       m_Width: 96
       m_Height: 96
       m_Kind: 0
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 0}
       m_Width: 72
       m_Height: 72
       m_Kind: 0
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 0}
       m_Width: 48
       m_Height: 48
       m_Kind: 0
       m_SubKind: 
-    - m_Textures: []
+    - m_Textures:
+      - {fileID: 0}
       m_Width: 36
       m_Height: 36
       m_Kind: 0
       m_SubKind: 
+    - m_Textures: []
+      m_Width: 432
+      m_Height: 432
+      m_Kind: 2
+      m_SubKind: 
+    - m_Textures: []
+      m_Width: 324
+      m_Height: 324
+      m_Kind: 2
+      m_SubKind: 
+    - m_Textures: []
+      m_Width: 216
+      m_Height: 216
+      m_Kind: 2
+      m_SubKind: 
+    - m_Textures: []
+      m_Width: 162
+      m_Height: 162
+      m_Kind: 2
+      m_SubKind: 
+    - m_Textures:
+      - {fileID: 0}
+      - {fileID: 2800000, guid: 6d84c7ff90ad32643b3b1824e6ca6c99, type: 3}
+      m_Width: 108
+      m_Height: 108
+      m_Kind: 2
+      m_SubKind: 
+    - m_Textures:
+      - {fileID: 2800000, guid: 6d84c7ff90ad32643b3b1824e6ca6c99, type: 3}
+      - {fileID: 0}
+      m_Width: 81
+      m_Height: 81
+      m_Kind: 2
+      m_SubKind: 
   m_BuildTargetBatching:
   - m_BuildTarget: Standalone
     m_StaticBatching: 1