import { _decorator, Component, Node } from 'cc'; import { ActiveSkillBase } from './ActiveSkillBase'; import { UmUtil } from '../../../../cc-common/cc-util/UmUtil'; import { GameGlobalData } from '../../global/GameGlobalData'; import { Vec3 } from 'cc'; import { UmLog } from '../../../../cc-common/cc-util/UmLog'; import { EACTIVE_SKILL_TYPE, GameDefine } from '../../config/GameDefine'; const { ccclass, property } = _decorator; @ccclass('ActiveSkill2') export class ActiveSkill2 extends ActiveSkillBase { euler: Vec3 = new Vec3(); public enableActiveSkill(data, parent) { super.enableActiveSkill(data, parent); this.skillType = Number(EACTIVE_SKILL_TYPE.SKILL_2); this.speed = this.speed / this.useTime; this.node.setScaleY(this.range); } protected update(dt: number): void { if (!GameGlobalData.Instance.isStatePlay() || this.isDestroying) return; this.node.position = Vec3.ZERO; if (this.euler.z <= -360.0) { this.destroyNode(); return; } this.euler.z -= dt * this.speed; this.node.setRotationFromEuler(this.euler); } }