先写出我的使用方法。
//初始化对象池,Test是当前类的名称,包含unuse和reuse方法
this.nodePool = new NodePool("Test");
this.nodePool.put(this.testNode);
this.testNode = this.nodePool.get(this.testNode);
//Test类中的方法
unuse() {
console.log("unuse");
}
reuse(args: any) {
console.log("reuse");
}
按理来说get和put的时候会触发reuse和unuse方法,但是并没有打印log。
对于reuse和unuse的实现接口_extensions_ccpool_node_pool__IPoolHandlerComponent
是私有接口无法继承,也看了关于NodePool源码,如果传入类或者组件名内包含reuse和unuse应该就会触发,但是不知为何不生效。
刚用ccc不是很熟悉,麻烦各位大佬分析下问题所在,感谢。