Parcourir la source

PGHJPG 下载显示

DGJ il y a 1 an
Parent
commit
4e652c87f5

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

@@ -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: 138.455, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 254.91, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5295285540247215458

+ 35 - 16
Assets/LangChaoRTC/Remote/ShowRoom/RoomInvite/Scripts/PngJpgItem.cs

@@ -1,8 +1,9 @@
-using System;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
+using static LangChaoRommMinIo;
 
 public class PngJpgItem : BaseFilePrefabItem
 {
@@ -11,21 +12,39 @@ public class PngJpgItem : BaseFilePrefabItem
     public override void Init(FileConfig fileConfig)
     {
         base.Init(fileConfig);
-        if (!string.IsNullOrEmpty(fileConfig.Url))
-        {
-            string url = fileConfig.Url;
-            if (!fileConfig.Url.Contains("http"))
-            {
-                url = "https://" + fileConfig.Url;
-            }
-            NetWorkHeaders.Instance.getNetTexture(url, null, (Texture tex) => {
-                if (tex)
-                {
-                    Adaption(tex);
-                    mainImage.texture = tex;
-                }
-            });
-        }
+
+        LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
+
+            Debug.Log("rfd==>" + rfd.url);
+            Debug.Log("rfd==>" + rfd.bytes.Length);
+
+            Texture2D texture = new Texture2D(10, 10);
+            texture.LoadImage(rfd.bytes);//流数据转换成Texture2D
+
+            texture.Apply();
+
+            Adaption(texture);
+            mainImage.texture = texture;
+        });
+
+
+        //if (!string.IsNullOrEmpty(fileConfig.Url))
+        //{
+        //    string url = fileConfig.Url;
+        //    if (!fileConfig.Url.Contains("http"))
+        //    {
+        //        url = "https://" + fileConfig.Url;
+        //    }
+        //    NetWorkHeaders.Instance.getNetTexture(url, null, (Texture tex) => {
+        //        if (tex)
+        //        {
+        //            Adaption(tex);
+        //            mainImage.texture = tex;
+        //        }
+        //    });
+
+
+        //}
     }
 
     public void Adaption(Texture tex)

+ 1 - 1
Assets/LangChaoRTC/Remote/ShowRoom/RoomMain.cs

@@ -300,7 +300,7 @@ public class RoomMain : RemoteSingleton<RoomMain>
         }
         if (PopCall.Instance)
         {
-            PopCall.Instance.gameObject.SetActive(false);
+          //  PopCall.Instance.gameObject.SetActive(false);
         }
         if (ShowRoom.Instance)
         {

+ 4 - 52
Assets/LangChaoRTC/Remote/ShowRoom/RoomMain.prefab

@@ -1595,19 +1595,7 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 2241088651301450029}
   m_OnClick:
     m_PersistentCalls:
-      m_Calls:
-      - m_Target: {fileID: 2507207545101761575}
-        m_TargetAssemblyTypeName: LiveRTCRoomMain, Assembly-CSharp
-        m_MethodName: SetVideo
-        m_Mode: 6
-        m_Arguments:
-          m_ObjectArgument: {fileID: 0}
-          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
-          m_IntArgument: 0
-          m_FloatArgument: 0
-          m_StringArgument: 
-          m_BoolArgument: 1
-        m_CallState: 2
+      m_Calls: []
 --- !u!1 &2241088651333374834
 GameObject:
   m_ObjectHideFlags: 0
@@ -1806,19 +1794,7 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 2241088651403055089}
   m_OnClick:
     m_PersistentCalls:
-      m_Calls:
-      - m_Target: {fileID: 2507207545101761575}
-        m_TargetAssemblyTypeName: LiveRTCRoomMain, Assembly-CSharp
-        m_MethodName: SetAudio
-        m_Mode: 6
-        m_Arguments:
-          m_ObjectArgument: {fileID: 0}
-          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
-          m_IntArgument: 0
-          m_FloatArgument: 0
-          m_StringArgument: 
-          m_BoolArgument: 1
-        m_CallState: 2
+      m_Calls: []
 --- !u!1 &2241088651471683787
 GameObject:
   m_ObjectHideFlags: 0
@@ -1941,19 +1917,7 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 2241088651471683788}
   m_OnClick:
     m_PersistentCalls:
-      m_Calls:
-      - m_Target: {fileID: 2507207545101761575}
-        m_TargetAssemblyTypeName: LiveRTCRoomMain, Assembly-CSharp
-        m_MethodName: SetVideo
-        m_Mode: 6
-        m_Arguments:
-          m_ObjectArgument: {fileID: 0}
-          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
-          m_IntArgument: 0
-          m_FloatArgument: 0
-          m_StringArgument: 
-          m_BoolArgument: 0
-        m_CallState: 2
+      m_Calls: []
 --- !u!1 &2241088651505987571
 GameObject:
   m_ObjectHideFlags: 0
@@ -3101,19 +3065,7 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 2241088652691173818}
   m_OnClick:
     m_PersistentCalls:
-      m_Calls:
-      - m_Target: {fileID: 2507207545101761575}
-        m_TargetAssemblyTypeName: LiveRTCRoomMain, Assembly-CSharp
-        m_MethodName: SetAudio
-        m_Mode: 6
-        m_Arguments:
-          m_ObjectArgument: {fileID: 0}
-          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
-          m_IntArgument: 0
-          m_FloatArgument: 0
-          m_StringArgument: 
-          m_BoolArgument: 0
-        m_CallState: 2
+      m_Calls: []
 --- !u!1 &2316171003018402862
 GameObject:
   m_ObjectHideFlags: 0

+ 2 - 2
Assets/LangChaoRTC/Remote/ShowRoom/ShowRoom.cs

@@ -159,7 +159,7 @@ public class ShowRoom : RemoteSingleton<ShowRoom>
         ShowMainScreen();
         if (PopCall.Instance)
         {
-            PopCall.Instance.gameObject.SetActive(false);
+           // PopCall.Instance.gameObject.SetActive(false);
         }
         transform.position = new Vector3(0, 0.9f, 0);
         transform.eulerAngles = new Vector3(0, 0, 0);
@@ -194,7 +194,7 @@ public class ShowRoom : RemoteSingleton<ShowRoom>
         ShowMainScreen();
         if (PopCall.Instance)
         {
-            PopCall.Instance.gameObject.SetActive(false);
+          //  PopCall.Instance.gameObject.SetActive(false);
         }
     }
 

+ 14 - 13
Assets/Scenes/LangChaoDemo2.unity

@@ -7662,8 +7662,8 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 583309982}
-  - component: {fileID: 583309981}
   - component: {fileID: 583309983}
+  - component: {fileID: 583309984}
   m_Layer: 0
   m_Name: Net
   m_TagString: Untagged
@@ -7671,18 +7671,6 @@ GameObject:
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 1
---- !u!114 &583309981
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 583309980}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 9eb2c1120b825d14dbaf47b974de7085, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
 --- !u!4 &583309982
 Transform:
   m_ObjectHideFlags: 0
@@ -7711,6 +7699,19 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   global: 1
+--- !u!114 &583309984
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 583309980}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 9b586d4b3fcf5d54a945e18d92a99f07, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  global: 1
 --- !u!1 &587736014
 GameObject:
   m_ObjectHideFlags: 0

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

@@ -5,6 +5,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Text;
 using UnityEngine;
+using static LangChaoRommMinIo;
 
 public class MQTTManager : MonoSingleton<MQTTManager>
 {
@@ -183,7 +184,12 @@ public class MQTTManager : MonoSingleton<MQTTManager>
                 // 拆解用户名  和 文件名称  显示到聊天框里   下载文件
                 FileConfig fileConfig = JsonConvert.DeserializeObject<FileConfig>(obj["chatMessage"].ToString());
                 fileConfig.From = obj["from"].ToString();
-                
+
+                Debug.Log(" DGJ ===> FileConfig  " + JsonConvert.SerializeObject(fileConfig));
+
+            
+
+
                 FileList.Instance.AddItem(fileConfig);
                 break;
             case "remark": // 空间标注

+ 9 - 9
Assets/Scripts/RTC/LiveRTCRoomMain.cs

@@ -47,11 +47,11 @@ public class LiveRTCRoomMain : MonoSingleton<LiveRTCRoomMain>,IController
     }
     private void OnInit()
     {
-        videoOpenBtn.onClick.AddListener(()=> { SetVideo(false); });
-        videoCloseBtn.onClick.AddListener(() => { SetVideo(true); });
+        videoOpenBtn.onClick.AddListener(()=> { SetVideo(true); });
+        videoCloseBtn.onClick.AddListener(() => { SetVideo(false); });
 
-        audioOpenBtn.onClick.AddListener(() => { SetAudio(false); });
-        audioCloseBtn.onClick.AddListener(() => { SetAudio(true); });
+        audioOpenBtn.onClick.AddListener(() => { SetAudio(true); });
+        audioCloseBtn.onClick.AddListener(() => { SetAudio(false); });
 
         clearArrowBtn.onClick.AddListener(ClearAllArrow);
         leaveRoomBtn.onClick.AddListener(() => { SetDefaultUI(true); });
@@ -64,16 +64,16 @@ public class LiveRTCRoomMain : MonoSingleton<LiveRTCRoomMain>,IController
     {
 
         GHZRtcManager.Instance.OnMicrophone(state);
-        audioCloseBtn.gameObject.SetActive(!state);
-        audioOpenBtn.gameObject.SetActive(state);
+        audioCloseBtn.gameObject.SetActive(state);
+        audioOpenBtn.gameObject.SetActive(!state);
     }
 
     public void SetVideo(bool state)
     {
        
         GHZRtcManager.Instance.OnWebCam(state);
-        videoCloseBtn.gameObject.SetActive(!state);
-        videoOpenBtn.gameObject.SetActive(state);
+        videoCloseBtn.gameObject.SetActive(state);
+        videoOpenBtn.gameObject.SetActive(!state);
     }
 
     public void ClearAllArrow()
@@ -132,7 +132,7 @@ public class LiveRTCRoomMain : MonoSingleton<LiveRTCRoomMain>,IController
         }
         if (PopCall.Instance)
         {
-            PopCall.Instance.gameObject.SetActive(false);
+          //  PopCall.Instance.gameObject.SetActive(false);
         }
         if (ShowRoom.Instance)
         {

+ 1 - 0
Assets/Scripts/RTC/RTCRoomManager.cs

@@ -239,6 +239,7 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
 
         if(rtcState != RTCEnum.OFF&& ScenesManager.Instance.getWindow() != ScenesManager.SceneType.ShowRTC)
         {
+            Debug.Log(" GETWindow Scenes   " + ScenesManager.Instance.getWindow());
             // 退出房间
             LeaveChannel();
         }