88using GameFrameX . Runtime ;
99using GameFrameX . Web . Runtime ;
1010using ProtoBuf ;
11- #if UNITY_WEBGL
12- using UnityEngine . Networking ;
13- #endif
1411
1512namespace GameFrameX . Web . ProtoBuff . Runtime
1613{
@@ -88,21 +85,21 @@ private void ShutdownProtoBuf()
8885 private async void MakeProtoBufBytesRequest ( WebProtoBufData webData )
8986 {
9087#if UNITY_WEBGL
91- UnityWebRequest unityWebRequest ;
88+ UnityEngine . Networking . UnityWebRequest unityWebRequest ;
9289 if ( webData . IsGet )
9390 {
94- unityWebRequest = UnityWebRequest . Get ( webData . URL ) ;
91+ unityWebRequest = UnityEngine . Networking . UnityWebRequest . Get ( webData . URL ) ;
9592 }
9693 else
9794 {
98- unityWebRequest = UnityWebRequest . Post ( webData . URL , string . Empty ) ;
95+ unityWebRequest = UnityEngine . Networking . UnityWebRequest . Post ( webData . URL , string . Empty ) ;
9996 }
10097
10198 unityWebRequest . timeout = ( int ) RequestTimeout . TotalSeconds ;
10299 {
103100 unityWebRequest . SetRequestHeader ( "Content-Type" , ProtoBufContentType ) ;
104101 byte [ ] postData = webData . SendData ;
105- unityWebRequest . uploadHandler = new UploadHandlerRaw ( postData ) ;
102+ unityWebRequest . uploadHandler = new UnityEngine . Networking . UploadHandlerRaw ( postData ) ;
106103 }
107104
108105 var asyncOperation = unityWebRequest . SendWebRequest ( ) ;
@@ -231,17 +228,16 @@ private void DebugReceiveLog(MessageObject messageObject)
231228 {
232229#if ENABLE_GAMEFRAMEX_WEB_RECEIVE_LOG
233230 var messageId = ProtoMessageIdHandler . GetReqMessageIdByType ( messageObject . GetType ( ) ) ;
234- Log . Debug ( $ "接收消息 ID:[{ messageId } ,{ messageObject . UniqueId } ,{ messageObject . GetType ( ) . Name } ] 消息内容:{ Utility . Json . ToJson ( messageObject ) } ") ;
235- #endif
236-
231+ Log . Debug ( $ "接收消息 ID:[{ messageId } ,{ messageObject . UniqueId } ,{ messageObject . GetType ( ) . Name } ] 消息内容:{ GameFrameX . Runtime . Utility . Json . ToJson ( messageObject ) } ") ;
232+ #endif
237233 }
238234
239235 private void DebugSendLog ( MessageObject messageObject )
240236 {
241237#if ENABLE_GAMEFRAMEX_WEB_SEND_LOG
242238 var messageId = ProtoMessageIdHandler . GetReqMessageIdByType ( messageObject . GetType ( ) ) ;
243- Log . Debug ( $ "发送消息 ID:[{ messageId } ,{ messageObject . UniqueId } ,{ messageObject . GetType ( ) . Name } ] 消息内容:{ Utility . Json . ToJson ( messageObject ) } ") ;
244- #endif
239+ Log . Debug ( $ "发送消息 ID:[{ messageId } ,{ messageObject . UniqueId } ,{ messageObject . GetType ( ) . Name } ] 消息内容:{ GameFrameX . Runtime . Utility . Json . ToJson ( messageObject ) } ") ;
240+ #endif
245241 }
246242 }
247243}
0 commit comments