diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index 4450e158..1d29137d 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -233,7 +233,6 @@ public class test : MonoBehaviour //} - //开始计时 void RoomStartTime() { @@ -310,6 +309,23 @@ public class test : MonoBehaviour wEBScriptListener.SendMessageByte(sendData); } + public void NpcMove() + { + MoveRequest data = new MoveRequest(); + data.RoomId = "168888"; + data.SelectId = 10821; + WSMessage msg = new WSMessage(); + msg.Module = "move"; + msg.ServiceName = "MoveNpc"; + msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data)); + byte[] sendData = ProtoBufffer.Serialize(msg); + WSMessage deinfo = ProtoBufffer.DeSerialize(sendData); + MoveRequest login = ProtoBufffer.DeSerialize(deinfo.Data.ToByteArray()); + Debug.Log("==========选择路线"); + //BroadcastFrameMsg.FramesFieldNumber + + wEBScriptListener.SendMessageByte(sendData); + } @@ -325,7 +341,7 @@ public class test : MonoBehaviour if (wEBScriptListener != null) { lodingWebSocket(); - //JoinRoom(); + JoinRoom(); Heartbeat(); //BroadcastMessage(); //UpFps(); @@ -336,6 +352,7 @@ public class test : MonoBehaviour //Location(); //TaskTrigger(); //TaskUpdateRequest(); + NpcMove(); } //int index = 0; //while (true) @@ -522,7 +539,7 @@ public class test : MonoBehaviour //更新任务 case "task.UpdateTask": Debug.Log("-----------task.TaskTrigger"); - TaskUpdateRequest taskUpdateRequest = ProtoBufffer.DeSerialize(bytes); + MoveRequest taskUpdateRequest = ProtoBufffer.DeSerialize(bytes); Debug.Log(taskUpdateRequest); break; @@ -534,13 +551,21 @@ public class test : MonoBehaviour Debug.Log(requestObject); break; + //对象触发操作 + case "move.MoveNpc": + Debug.Log("-----------move.MoveNpc"); + MoveRequest moveRequest = ProtoBufffer.DeSerialize(bytes); + Debug.Log(moveRequest); + + break; + + - - //case "prop.CreateNpc": - // MoveResponse moveResponse = ProtoBufffer.DeSerialize(bytes); - // Debug.Log("UserId:" + moveResponse.UserId + ",RoomId:" + moveResponse.RoomId + ",x:" + moveResponse.MoveData); - // break; + //case "prop.CreateNpc": + // MoveResponse moveResponse = ProtoBufffer.DeSerialize(bytes); + // Debug.Log("UserId:" + moveResponse.UserId + ",RoomId:" + moveResponse.RoomId + ",x:" + moveResponse.MoveData); + // break; diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index 173bb267..14861df6 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -7853,7 +7853,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 810501276} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -18.09, y: 0.5, z: 35.56} + m_LocalPosition: {x: 30, y: 0.5, z: 22.74} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -10869,6 +10869,10 @@ PrefabInstance: propertyPath: m_Name value: obj202 objectReference: {fileID: 0} + - target: {fileID: -8282288472169970500, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj224 + objectReference: {fileID: 0} - target: {fileID: -6327141709703751677, guid: eec919b17e074b747899fe01d7888a2c, type: 3} propertyPath: m_Name value: obj153 @@ -10881,10 +10885,26 @@ PrefabInstance: propertyPath: m_Name value: obj024 objectReference: {fileID: 0} + - target: {fileID: -3237221884521187588, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj222 + objectReference: {fileID: 0} + - target: {fileID: -2654505143154747466, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj220 + objectReference: {fileID: 0} - target: {fileID: -1788689016301746583, guid: eec919b17e074b747899fe01d7888a2c, type: 3} propertyPath: m_Name value: obj205 objectReference: {fileID: 0} + - target: {fileID: -241233108021658044, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj210 + objectReference: {fileID: 0} + - target: {fileID: -106440716057841632, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj221 + objectReference: {fileID: 0} - target: {fileID: 919132149155446097, guid: eec919b17e074b747899fe01d7888a2c, type: 3} propertyPath: m_Name value: school03 @@ -10897,14 +10917,46 @@ PrefabInstance: propertyPath: m_Name value: obj204 objectReference: {fileID: 0} + - target: {fileID: 3184295249035706133, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj208 + objectReference: {fileID: 0} - target: {fileID: 4315024395822287230, guid: eec919b17e074b747899fe01d7888a2c, type: 3} propertyPath: m_Name value: obj198 objectReference: {fileID: 0} + - target: {fileID: 5427673003371859311, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj223 + objectReference: {fileID: 0} + - target: {fileID: 7077992237008472060, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj206 + objectReference: {fileID: 0} + - target: {fileID: 7322491252510880854, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj226 + objectReference: {fileID: 0} + - target: {fileID: 7455878101187352886, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj225 + objectReference: {fileID: 0} - target: {fileID: 8052244126148009048, guid: eec919b17e074b747899fe01d7888a2c, type: 3} propertyPath: m_Name value: obj122 objectReference: {fileID: 0} + - target: {fileID: 8443362320608252490, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj207 + objectReference: {fileID: 0} + - target: {fileID: 8661539485286681749, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj209 + objectReference: {fileID: 0} + - target: {fileID: 8816389197232921522, guid: eec919b17e074b747899fe01d7888a2c, type: 3} + propertyPath: m_Name + value: obj219 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: eec919b17e074b747899fe01d7888a2c, type: 3} --- !u!1 &1124162635 stripped