private static void EnterMap(RoleServer curRole, int mapId) { var sceneId = mapId; EnterMapCmd enterMapCmd = new EnterMapCmd() { mapId = sceneId }; //生成主角 CreateSceneRole roleCmd = new CreateSceneRole(); roleCmd.thisId = curRole.thisID; roleCmd.name = curRole.name; roleCmd.modelId = curRole.modelId; roleCmd.pos = new float3(0, 0, 0); roleCmd.faceTo = Vector3.forward; roleCmd.hp = curRole.hp; roleCmd.maxHp = curRole.hp; roleCmd.attack = curRole.attack; roleCmd.defence = curRole.defence; Server.instance.SendCmd(enterMapCmd); Server.instance.SendCmd(roleCmd); //生成附近的配角(暂时不考虑) //生成附近的Npc //CreateSceneRole进场景 CreateSmoeNpc(); }
public static void OnEnterMap(Cmd cmd) { if (!CmdManager.instance.CheckCmd(cmd, typeof(EnterMapCmd))) { return; } EnterMapCmd enterMapCmd = cmd as EnterMapCmd; ScenesManager.instance.LoadScene(enterMapCmd.MapID); }
internal static void OnEnterMap(Cmd cmd) { if (!Net.CheckCmd(cmd, typeof(EnterMapCmd))) { return; } EnterMapCmd enterMapCmd = cmd as EnterMapCmd; // 跳转地图时,要重置RoleMgr、摇杆事件/摇杆状态、场景触摸事件、UI事件 Reset(); //enterMapCmd.mapId SceneMgr.instance.loadScene(enterMapCmd.mapId); }