コード例 #1
0
        private FireBoxRoom MakeRoom()
        {
            FireBoxRoom fireBoxRoom  = new FireBoxRoom();
            float       uniformScale = room.UniformScale;

            // copy data
            fireBoxRoom.Assets.Assets    = room.AllAssets.ToArray();
            fireBoxRoom.Room.Elements    = room.RoomElements.ToArray();
            fireBoxRoom.Room.FarDistance = room.FarPlaneDistance;

            if (room.PortalPos != null)
            {
                fireBoxRoom.Room.pos  = JanusUtil.FormatVector3(room.PortalPos.Value);
                fireBoxRoom.Room.xdir = JanusUtil.FormatVector3(room.PortalXDir.Value);
                fireBoxRoom.Room.ydir = JanusUtil.FormatVector3(room.PortalYDir.Value);
                fireBoxRoom.Room.zdir = JanusUtil.FormatVector3(room.PortalZDir.Value);
            }

            // implicit operators
            fireBoxRoom.Room.skybox_back_id  = room.SkyboxBack;
            fireBoxRoom.Room.skybox_front_id = room.SkyboxFront;
            fireBoxRoom.Room.skybox_left_id  = room.SkyboxLeft;
            fireBoxRoom.Room.skybox_right_id = room.SkyboxRight;
            fireBoxRoom.Room.skybox_up_id    = room.SkyboxUp;
            fireBoxRoom.Room.skybox_down_id  = room.SkyboxDown;

            fireBoxRoom.Room.cubemap_irradiance_id = room.CubemapIrradiance;
            fireBoxRoom.Room.cubemap_radiance_id   = room.CubemapRadiance;

            return(fireBoxRoom);
        }
コード例 #2
0
        public void WriteHtml(string path)
        {
            LightmapExportType lightmapExportType = room.LightmapType;
            float uniformScale = room.UniformScale;

            XmlWriterSettings settings = new XmlWriterSettings();

            settings.OmitXmlDeclaration = true;
            settings.Encoding           = Encoding.UTF8;

            builder           = new StringBuilder();
            writer            = (XmlTextWriter)XmlWriter.Create(builder, settings);
            writer.Formatting = Formatting.Indented;

            writer.WriteStartDocument();
            writer.WriteStartElement("html");

            writer.WriteStartElement("head");
            writer.WriteStartElement("title");
            writer.WriteString("Janus Unity Exporter v" + JanusGlobals.Version);
            writer.WriteEndElement();
            writer.WriteEndElement();

            writer.WriteStartElement("body");

            FireBoxRoom   fireBoxRoom           = MakeRoom();
            XmlSerializer fireBoxRoomSerializer = new XmlSerializer(typeof(FireBoxRoom));

            fireBoxRoomSerializer.Serialize(writer, fireBoxRoom, fireBoxRoom.Namespaces);

            writer.WriteEndDocument();

            writer.Close();
            writer.Flush();

            UnityUtil.WriteAllText(path, builder.ToString());
            return;
        }