public YamlMinMaxCurve(YamlMappingNode mainNode) { MainNode = mainNode; var p = mainNode; YamlNode node = null; if (p.Children.TryGetValue("scalar", out node)) { ScalarNode = node as YamlScalarNode; } if (p.Children.TryGetValue("maxCurve", out node)) { MaxCurveNode = node as YamlMappingNode; MaxCurve = new YamlAnimationCurve(MaxCurveNode); } if (p.Children.TryGetValue("minCurve", out node)) { MinCurveNode = node as YamlMappingNode; MinCurve = new YamlAnimationCurve(MinCurveNode); } if (p.Children.TryGetValue("minMaxState", out node)) { MinMaxStateNode = node as YamlScalarNode; } }
public void AddKeyFrame(YamlAnimationCurve curve, Keyframe frame) { if (MinMaxMode == ParticleSystemCurveMode.Constant || MinMaxMode == ParticleSystemCurveMode.TwoConstants) { Debug.LogError("不是曲线模式 加个P的帧 Mode :" + MinMaxMode); return; } curve.AddKeyFrame(frame); }