Ejemplo n.º 1
0
    public static List <GameObject> InitializeRoom(GameObject room)
    {
        if (!NetworkManagerCustom.IsServer)
        {
            return(null);
        }

        List <GameObject> objects = RoomLoader.SpawnSerializebleObjects(RoomLoader.loadedRooms.Find(x => x.fileName.Equals(room.GetComponent <Room>().RoomName)), room);

        foreach (GameObject gameObject in objects)
        {
            if (gameObject.GetComponent <ISerializableObject>() != null)
            {
                SerializationManager.InitializeObject(gameObject);
            }
        }

        room.GetComponent <Room>().Initialized = true;
        return(objects);
    }