private bool DidReceiveGeneratorNPC(int wHandleCode, byte[] wByteBuffer, int wDataSize)
        {
            int dataLen = wByteBuffer.Length;

            if (dataLen < wDataSize)
            {
                Debug.LogError("Generator NPC data Error!!");
                return(false);
            }
            CMD_SC_NPC_GENERATOR npcGenerator = GameConvert.ByteToStruct <CMD_SC_NPC_GENERATOR>(wByteBuffer, wByteBuffer.Length);

            //			Debug.Log("****************************************");
            //			Debug.Log("NPC_GENERATOR_ServerTime==========="+npcGenerator.gsServerTime);
            //			Debug.Log("NPC_GENERATOR_ServerId============="+npcGenerator.gsServerId);
            //			Debug.Log("NPC_GENERATOR_ActorId=============="+npcGenerator.gsActorId);
            //			Debug.Log("NPC_GENERATOR_NavigId=============="+npcGenerator.gsNavigId);
            //			Debug.Log("NPC_GENERATOR_NavigRot============="+npcGenerator.gsNavigRot);
            //			Debug.Log("NPC_GENERATOR_Z===================="+npcGenerator.gsZ);
            //			Debug.Log("NPC_GENERATOR_Y===================="+npcGenerator.gsY);
            //			Debug.Log("****************************************");

            if (onReceiveGeneratorNPCEvent != null)
            {
                onReceiveGeneratorNPCEvent(npcGenerator);
            }

            return(true);
        }
示例#2
0
        public void S_C_NPC_Generator(CMD_SC_NPC_GENERATOR _npcGen)
        {
            // 通过名字获取路径.
            string     _npcName = IdMap.GetIdMapInfo(_npcGen.gsActorId);
            NavigParam _np      = NavigationMap.GetActorNavigation(_npcGen.gsNavigId);

            Vector3 [] _pathNodes = _np.path.ToArray();

            // 把路径适配到本地设备.
            _pathNodes = Utility.TransformPosZ2X(_pathNodes);
            // 路径时间.
            float _timeLength = _np.timeLength;

            PathCtrl.Instance.S_C_NPC_Generator(_npcGen.gsServerTime, _npcGen.gsServerId, _npcName, _pathNodes, _timeLength, _npcGen.gsNavigRot, _npcGen.gsZ, _npcGen.gsY);
        }