返回介绍

Animation.Play 播放

发布于 2019-12-18 15:37:09 字数 2726 浏览 943 评论 0 收藏 0

JavaScript => public function Play(mode: PlayMode = PlayMode.StopSameLayer): bool;
JavaScript => public function Play(animation: string, mode: PlayMode = PlayMode.StopSameLayer): bool;
JavaScript => public function Play(mode: PlayMode = PlayMode.StopSameLayer): bool;
JavaScript => public function Play(animation: string, mode: PlayMode = PlayMode.StopSameLayer): bool;

C# => public bool Play(PlayMode mode = PlayMode.StopSameLayer);
C# => public bool Play(string animation, PlayMode mode = PlayMode.StopSameLayer);
C# => public bool Play(PlayMode mode = PlayMode.StopSameLayer);
C# => public bool Play(string animation, PlayMode mode = PlayMode.StopSameLayer);

Description 描述

Plays an animation without any blending.

不带有任何混合的播放动画。

If no name is supplied then the default animation will be played. In cases where the animation can't be played (ie, there is no default animation or no animation with the specified name), the function will return false.

如果不指定名称那么回播放默认动画。在无默认动画或没有指定名称的动画,那么不会播放动画并返回null。

The optional playMode lets you choose how this animation will affect others already playing.

playMode选项是让你选择该动画怎样影响其他正播放的动画。

If the specified animation is already playing then other animations will be stopped but the animation will not rewind to the beginning.

如果指定的动画正在播放,那么其他的动画将被停止,但是该动画不会回到开头。

When the end of the animation is reached it will automatically be stopped and rewound to the start unless the PlayMode is set to Loop.

当达到动画结束将自动停止并倒回到开始,除非播放模式设置为循环。

Note that if you call Animation.Play on an object during a frame update where the object is also deactivated then the call will effectively be cancelled; the animation will not start playing when the object is later reactivated. However, if you make the call on a subsequent frame (ie, while the object is still inactive) then the animation will start playing after reactivation.

注意如果对象在更新期间调用Animation.Play,对象被取消激活,那么播放会取消;当对象之后从新被激活,动画也不会开始播放。 但是,如果你后续帧的继续调用(即,而对象仍然处于非活动状态),则动画将在对象重新激活后开始播放。

Animation

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文