public RoomSettings(string lobbyName, GameMode.Mode gameMode, GameMap.Map map, uint maxPlayers) { this.lobbyName = lobbyName; lobbyGameMode = gameMode; lobbyMap = map; currentPlayerCount = 0; maxPlayerCount = maxPlayers; }
public void SetRoom(string nameInput, int sizeInput, int countInput, int modeInput, int mapInput) { roomName = nameInput; roomSize = sizeInput; playerCount = countInput; roomMode = GameMode.GetModeByID(modeInput); roomMap = GameMap.GetMapByID(mapInput); roomNameDisplay.text = nameInput; roomSizeDisplay.text = countInput + "/" + sizeInput; roomModeDisplay.text = GameMode.GetNameByID(modeInput); roomMapDisplay.text = GameMap.GetNameByID(mapInput); }
public void CreateRoom() { string name = roomNameInput.text; GameMode.Mode mode = GameMode.GetModeByID(roomGameModeInput.value); GameMap.Map map = GameMap.GetMapByID(roomMapInput.value); uint maxPlayers = (uint)roomMaxPlayerInput.value + 1; RoomOptions options = new RoomOptions() { IsVisible = true, IsOpen = true, EmptyRoomTtl = 3000, MaxPlayers = System.Convert.ToByte(maxPlayers), CustomRoomPropertiesForLobby = new string[] { MODE_PROP_KEY, MAP_PROP_KEY }, CustomRoomProperties = new ExitGames.Client.Photon.Hashtable { { MODE_PROP_KEY, mode }, { MAP_PROP_KEY, map } } }; PhotonNetwork.CreateRoom(name, options); }
void Start() { //mesh = GetComponent<MeshFilter>().mesh; map = new GameMap.Map(width); map.MakeBox(); map.CullHidden(); //MeshGenerator.CubeMesh cubeMesh = new MeshGenerator.CubeMesh(ref map); MeshGenerator.MarchingMesh marchingMesh = new MeshGenerator.MarchingMesh(ref map); //vertices = cubeMesh.vertexList; //triangles = cubeMesh.triangleList; //vertices = marchingMesh.vertexList; vertices = marchingMesh.debugList; triangles = marchingMesh.triangleList; //vertices = map.GetCubeVertices(); //mesh = map.GetCubeMesh(ref vertices, ref normals, ref triangles); //GetComponent<MeshFilter>().mesh = cubeMesh.GetCubeMesh(); GetComponent <MeshFilter>().mesh = marchingMesh.GetMarchingMesh(); //triangles = map.GetTriangleList(); //GetComponent<MeshFilter>().mesh.normals //GetComponent<MeshFilter>().mesh.vertices = vertices.ToArray(); //GetComponent<MeshFilter>().mesh.triangles = triangles.ToArray(); GetComponent <MeshCollider>().sharedMesh = GetComponent <MeshFilter>().sharedMesh; }