1234567891011121314151617181920212223242526272829 |
- import { _decorator, Component, Node, ParticleSystem2D, tween, Vec3 } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('qiyou_effect_item')
- export class qiyou_effect_item extends Component {
- @property(ParticleSystem2D) particle:ParticleSystem2D = null
- private mIsCanUse:boolean = true
- public init(){
- this.node.active = false
- }
- public show(qiyou_p:Vec3){
- this.node.active = true
- this.node.position = new Vec3(qiyou_p.x,qiyou_p.y)
- this.particle.resetSystem()
- this.mIsCanUse = false
- tween(this.node).delay(2).call(()=>{
- this.mIsCanUse = true
- this.node.active = false
- this.particle.stopSystem()
- }).start()
- }
- public IsCanUse(){
- return this.mIsCanUse
- }
- }
|