Example #1
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Ratio = reader.ReadSingle();
            Light.Read(reader);
            RandomDistribution = reader.ReadBoolean();
            Color     = reader.ReadBoolean();
            Range     = reader.ReadBoolean();
            Intensity = reader.ReadBoolean();
            RangeCurve.Read(reader);
            IntensityCurve.Read(reader);
            MaxLights = reader.ReadInt32();
        }
Example #2
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Ratio = stream.ReadSingle();
            Light.Read(stream);
            RandomDistribution = stream.ReadBoolean();
            Color     = stream.ReadBoolean();
            Range     = stream.ReadBoolean();
            Intensity = stream.ReadBoolean();
            RangeCurve.Read(stream);
            IntensityCurve.Read(stream);
            MaxLights = stream.ReadInt32();
        }
Example #3
0
        public override YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(container);

            node.Add(RatioName, Ratio);
            node.Add(LightName, Light.ExportYAML(container));
            node.Add(RandomDistributionName, RandomDistribution);
            node.Add(ColorName, Color);
            node.Add(RangeName, Range);
            node.Add(IntensityName, Intensity);
            node.Add(RangeCurveName, RangeCurve.ExportYAML(container));
            node.Add(IntensityCurveName, IntensityCurve.ExportYAML(container));
            node.Add(MaxLightsName, MaxLights);
            return(node);
        }
Example #4
0
        public override YAMLNode ExportYAML(IAssetsExporter exporter)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(exporter);

            node.Add("ratio", Ratio);
            node.Add("light", Light.ExportYAML(exporter));
            node.Add("randomDistribution", RandomDistribution);
            node.Add("color", Color);
            node.Add("range", Range);
            node.Add("intensity", Intensity);
            node.Add("rangeCurve", RangeCurve.ExportYAML(exporter));
            node.Add("intensityCurve", IntensityCurve.ExportYAML(exporter));
            node.Add("maxLights", MaxLights);
            return(node);
        }
Example #5
0
    public static AnimationCurve GetAnimationCurve(IntensityCurve type)
    {
        switch (type)
        {
        case IntensityCurve.Invariant:
            return(AnimationCurve.Linear(0f, 1f, 1f, 1f));

        case IntensityCurve.LinearIncreasing:
            return(AnimationCurve.Linear(0f, 0f, 1f, 1f));

        case IntensityCurve.LinearDecreasing:
            return(AnimationCurve.Linear(0f, 1f, 1f, 0f));

        case IntensityCurve.SmoothSpike:
            AnimationCurve c = new AnimationCurve();
            c.AddKey(0f, 0f);
            c.AddKey(.5f, 1f);
            c.AddKey(1f, 0f);
            return(c);
        }

        return(AnimationCurve.Linear(0f, 1f, 1f, 1f));
    }