buff_dun_chong.ts 468 B

123456789101112131415
  1. import { _decorator, Animation, Component, Node, UITransform, Vec3 } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('buff_dun_chong')
  4. export class buff_dun_chong extends Component {
  5. public init(){
  6. this.node.position = new Vec3(0,this.node.parent.getComponent(UITransform).contentSize.height*-1)
  7. }
  8. public playAnimation(){
  9. // this.node.getComponent(Animation).stop()
  10. this.node.getComponent(Animation).play()
  11. }
  12. }