public void LoadAppartment(NetworkMessage netMsg) { AppartmentLoadingMessage msg = netMsg.ReadMessage <AppartmentLoadingMessage>(); GameObject appartment = Instantiate(Resources.Load <GameObject>("Appartments/" + msg.modelName + "/" + msg.modelName)); appartment.transform.position = msg.appartmentPosition; appartment.transform.localScale = msg.appartmentScale; client.Send(VirtualHausMessageTypes.APPARTMENT_LOADED, new EmptyMessage()); status = ClientStatus.APPARTMENT_LOADED; }
public void OnClientConnect(NetworkMessage netMsg) { connectionsReady.Add(netMsg.conn.connectionId, false); AppartmentLoadingMessage appartmentLoadingMessage = new AppartmentLoadingMessage { appartmentScale = currentAppartment.transform.localScale, appartmentPosition = currentAppartment.transform.position, modelName = currentAppartment.transform.name }; NetworkServer.SendToClient(netMsg.conn.connectionId, VirtualHausMessageTypes.APPARTMENT_LOADING, appartmentLoadingMessage); }