add tween function destroySelf (#14309)

This commit is contained in:
zhakesi
2023-02-27 19:37:42 +08:00
committed by GitHub
parent b552edc1bd
commit ad28fd20b7
+12
View File
@@ -389,6 +389,18 @@ export class Tween<T> {
return this;
}
/**
* @en
* Add a destroySelf action, only for node target.
* @zh
* 添加一个移除并销毁自己 action,只适用于 target 是节点类型的。
*/
destroySelf (): Tween<T> {
const action = removeSelf(true);
this._actions.push(action);
return this;
}
/**
* @en
* Stop all tweens