animcurve_exists

如果给定的动画曲线资源动画曲线结构存在并且是有效的动画曲线,则此函数返回布尔值。

 

语法:

animcurve_exists(curve_struct_or_id);

参数类型描述
curve_struct_or_idAnimation Curve Struct or Animation Curve Asset将选中的动画曲线资源或结构。

 

返回:

Boolean

 

例子:

if (animcurve_exists(spring_curve))
{
    apply_spring_animation(sprite_curve);
}

上述代码检查存储在自定义spring_curve变量中的动画曲线是否存在。如果是这样,它将运行一个自定义方法来使用该动画曲线。