mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
1d14c0bc93
* refactor_tween (#5794) * copy from master branch cocos2d actions * tweaks & stash * tweaks * stash * stash * tweaks * fix repeatForever init * fix repeat、repeatForever、reverseTime * add elastic out in to easing * add typing * add adapter & checker; add api doc; * tweaks * fix tween number * tweaks * tweaks * remove tween.js * rename actions to tween * export Tween * allow mutiple remove action * using new api * remove deprecated from tween * add deprecated to tweenUtil * fix ci test
37 lines
711 B
TypeScript
37 lines
711 B
TypeScript
/**
|
|
* @hidden
|
|
*/
|
|
|
|
import { ActionInstant} from './actions/action-instant';
|
|
|
|
export class SetAction extends ActionInstant {
|
|
|
|
private _props: any;
|
|
|
|
constructor (props?: any) {
|
|
super();
|
|
this._props = {};
|
|
props !== undefined && this.init(props);
|
|
}
|
|
|
|
init (props) {
|
|
for (let name in props) {
|
|
this._props[name] = props[name];
|
|
}
|
|
return true;
|
|
}
|
|
|
|
update () {
|
|
let props = this._props;
|
|
let target = this.target;
|
|
for (let name in props) {
|
|
target![name] = props[name];
|
|
}
|
|
}
|
|
|
|
clone () {
|
|
var action = new SetAction();
|
|
action.init(this._props);
|
|
return action;
|
|
}
|
|
} |