12345678910111213141516171819202122232425 |
- /** @format */
- import {EventProcess} from './EventProcess'
- import FrameAnimation from '../../uiutils/FrameAnimation'
- import {IFrameAniConfig} from '../../config/FrameAniConfig'
- import {ANI_TYPE} from '../../enums/Enum'
- const {ccclass, property} = cc._decorator
- @ccclass
- export class FrameAniProcess extends EventProcess {
- frameAnimation: FrameAnimation
- aniConfig: IFrameAniConfig
- onAttach(): void {
- this.frameAnimation = this.getComponent(FrameAnimation)
- if (this.aniConfig.url) {
- if (this.aniConfig.type == ANI_TYPE.frameAni) {
- this.playFrameAni(`skill/${this.aniConfig.url}`, Boolean(this.aniConfig.loop), this.aniConfig.duration)
- } else if (this.aniConfig.type == ANI_TYPE.action) {
- this.playAnimation(`skill/${this.aniConfig.url}`)
- }
- }
- }
- }
|