import { _decorator, Collider2D, Contact2DType, IPhysics2DContact, Node, tween, v3, Vec3 } from 'cc';
import { NodeEx } from '../../framework/pool/NodeEx';
const { ccclass, property } = _decorator;

@ccclass('BulletNode')
export class BulletNode extends NodeEx {

	protected onLoad() {
		
	}
	setGoPos(pos,back) {
		let direction = 0.2

		if (pos < 0) {
			direction = -0.2
		}
		this.node.scale = new Vec3(direction, 0.2, 0.2)
		tween(this.node).to(0.2, { position: pos }).call(() => {
			back()
		}).start();
	}
	protected onDestroy() {
		//如果该组件有事件自行取消注释
		//Framework.event.removeEvent(this);
		super.onDestroy();
	}

	//节点被放入池中时调用
	unuse() {

	}

	//节点从池中取出时调用
	reuse(...val: any[]) {

	}
}