예제 #1
0
    public static IPartSysParam Parse(PartSysParamId id, ReadOnlySpan <byte> value, float emitterLifespan,
                                      float particleLifespan, out bool success)
    {
        // Look up the default value
        var defaultValue = PartSysParamDefaultValues.GetDefaultValue(id);

        // Do we have to use the particle or emitter lifespan as reference for keyframes?
        var lifespan = (id >= PartSysParamId.part_accel_X) ? particleLifespan : emitterLifespan;

        return(Parse(value, defaultValue, lifespan, out success));
    }
 public void GetDefaultValue()
 {
     Assert.AreEqual(0, PartSysParamDefaultValues.GetDefaultValue(PartSysParamId.part_accel_X));
     Assert.AreEqual(255, PartSysParamDefaultValues.GetDefaultValue(PartSysParamId.emit_init_alpha));
     Assert.AreEqual(1, PartSysParamDefaultValues.GetDefaultValue(PartSysParamId.emit_scale_X));
 }