如果给定的动画曲线资源或动画曲线结构存在并且是有效的动画曲线,则此函数返回布尔值。
animcurve_exists(curve_struct_or_id);
参数 | 类型 | 描述 |
---|---|---|
curve_struct_or_id | Animation Curve Struct or Animation Curve Asset | 将选中的动画曲线资源或结构。 |
if (animcurve_exists(spring_curve))
{
apply_spring_animation(sprite_curve);
}
上述代码检查存储在自定义spring_curve变量中的动画曲线是否存在。如果是这样,它将运行一个自定义方法来使用该动画曲线。