Ejemplo n.º 1
0
 public void Read(AssetStream stream)
 {
     Prototype.Read(stream);
     PrototypeTexture.Read(stream);
     MinWidth    = stream.ReadSingle();
     MaxWidth    = stream.ReadSingle();
     MinHeight   = stream.ReadSingle();
     MaxHeight   = stream.ReadSingle();
     NoiseSpread = stream.ReadSingle();
     BendFactor  = stream.ReadSingle();
     HealthyColor.Read(stream);
     DryColor.Read(stream);
     if (IsReadGrayscaleLighting(stream.Version))
     {
         GrayscaleLighting = stream.ReadInt32();
     }
     LightmapFactor   = stream.ReadSingle();
     RenderMode       = stream.ReadInt32();
     UsePrototypeMesh = stream.ReadInt32();
 }
Ejemplo n.º 2
0
        public YAMLNode ExportYAML(IAssetsExporter exporter)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = new YAMLMappingNode();
            node.AddSerializedVersion(GetSerializedVersion(exporter.Version));
            node.Add("prototype", Prototype.ExportYAML(exporter));
            node.Add("prototypeTexture", PrototypeTexture.ExportYAML(exporter));
            node.Add("minWidth", MinWidth);
            node.Add("maxWidth", MaxWidth);
            node.Add("minHeight", MinHeight);
            node.Add("maxHeight", MaxHeight);
            node.Add("noiseSpread", NoiseSpread);
            node.Add("bendFactor", BendFactor);
            node.Add("healthyColor", HealthyColor.ExportYAML(exporter));
            node.Add("dryColor", DryColor.ExportYAML(exporter));
            node.Add("lightmapFactor", LightmapFactor);
            node.Add("renderMode", RenderMode);
            node.Add("usePrototypeMesh", UsePrototypeMesh);
            return(node);
        }
Ejemplo n.º 3
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion));
            node.Add(PrototypeName, Prototype.ExportYAML(container));
            node.Add(PrototypeTextureName, PrototypeTexture.ExportYAML(container));
            node.Add(MinWidthName, MinWidth);
            node.Add(MaxWidthName, MaxWidth);
            node.Add(MinHeightName, MinHeight);
            node.Add(MaxHeightName, MaxHeight);
            node.Add(NoiseSpreadName, NoiseSpread);
            node.Add(BendFactorName, BendFactor);
            node.Add(HealthyColorName, HealthyColor.ExportYAML(container));
            node.Add(DryColorName, DryColor.ExportYAML(container));
            node.Add(LightmapFactorName, LightmapFactor);
            node.Add(RenderModeName, (int)RenderMode);
            node.Add(UsePrototypeMeshName, UsePrototypeMesh);
            return(node);
        }
Ejemplo n.º 4
0
 public void Read(AssetReader reader)
 {
     Prototype.Read(reader);
     PrototypeTexture.Read(reader);
     MinWidth    = reader.ReadSingle();
     MaxWidth    = reader.ReadSingle();
     MinHeight   = reader.ReadSingle();
     MaxHeight   = reader.ReadSingle();
     NoiseSpread = reader.ReadSingle();
     BendFactor  = reader.ReadSingle();
     HealthyColor.Read(reader);
     DryColor.Read(reader);
     if (IsReadGrayscaleLighting(reader.Version))
     {
         GrayscaleLighting = reader.ReadInt32();
     }
     LightmapFactor   = reader.ReadSingle();
     RenderMode       = (DetailRenderMode)reader.ReadInt32();
     UsePrototypeMesh = reader.ReadInt32();
 }
Ejemplo n.º 5
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("prototype", Prototype.ExportYAML(container));
            node.Add("prototypeTexture", PrototypeTexture.ExportYAML(container));
            node.Add("minWidth", MinWidth);
            node.Add("maxWidth", MaxWidth);
            node.Add("minHeight", MinHeight);
            node.Add("maxHeight", MaxHeight);
            node.Add("noiseSpread", NoiseSpread);
            node.Add("bendFactor", BendFactor);
            node.Add("healthyColor", HealthyColor.ExportYAML(container));
            node.Add("dryColor", DryColor.ExportYAML(container));
            node.Add("lightmapFactor", LightmapFactor);
            node.Add("renderMode", RenderMode);
            node.Add("usePrototypeMesh", UsePrototypeMesh);
            return(node);
        }
 public void Write(AssetWriter writer)
 {
     Prototype.Write(writer);
     PrototypeTexture.Write(writer);
     writer.Write(MinWidth);
     writer.Write(MaxWidth);
     writer.Write(MinHeight);
     writer.Write(MaxHeight);
     writer.Write(NoiseSpread);
     writer.Write(BendFactor);
     writer.Write(BendFactor);
     HealthyColor.Write(writer);
     DryColor.Write(writer);
     if (HasGrayscaleLighting(writer.Version))
     {
         writer.Write(GrayscaleLighting);
     }
     writer.Write(LightmapFactor);
     writer.Write((int)RenderMode);
     writer.Write(UsePrototypeMesh);
 }
Ejemplo n.º 7
0
        public IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false)
        {
            yield return(Prototype.FetchDependency(file, isLog, () => nameof(DetailPrototype), "prototype"));

            yield return(PrototypeTexture.FetchDependency(file, isLog, () => nameof(DetailPrototype), "prototypeTexture"));
        }