card 显示修改
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, v3 } from "cc";
|
||||
import { _decorator, tween, v3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
@@ -64,13 +64,29 @@ export class CardsCompComp extends CCComp {
|
||||
}
|
||||
|
||||
show(e:GameEvent,data:any){
|
||||
this.node.setPosition(v3(0,640,0))
|
||||
// console.log("cards show",e,this.node.position)
|
||||
// 设置初始状态
|
||||
this.node.setPosition(v3(0, 0, 0));
|
||||
this.node.setScale(v3(0, 0, 1));
|
||||
|
||||
// 使用缓动动画放大和移动
|
||||
tween(this.node)
|
||||
.parallel(
|
||||
tween().to(0.3, { scale: v3(1, 1, 1) }, { easing: 'backOut' }),
|
||||
tween().to(0.3, { position: v3(0, 640, 0) }, { easing: 'backOut' })
|
||||
)
|
||||
.start();
|
||||
}
|
||||
|
||||
hide(e:GameEvent,data:any){
|
||||
this.node.setPosition(v3(0,-1000,0))
|
||||
// console.log("cards hide",e,this.node.position)
|
||||
tween(this.node)
|
||||
.parallel(
|
||||
tween().to(0.3, { scale: v3(0, 0, 1) }, { easing: 'backIn' }),
|
||||
tween().to(0.3, { position: v3(0, 0, 0) }, { easing: 'backIn' })
|
||||
)
|
||||
.call(()=>{
|
||||
this.node.setPosition(v3(0, -1000, 0));
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
|
||||
Reference in New Issue
Block a user