Files
cocos4/cocos/tween/set-action.ts
T
jiaxin.lai 1d14c0bc93 refactor_tween (#5794) (#5943)
* 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
2019-12-23 16:22:48 +08:00

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;
}
}