- MVP架构重构聊天逻辑
- 优化聊天气泡体验 - 修复prompt bug - 实现聊天次数限制功能(未接服务端) - 实现情绪切视频功能
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
import { _decorator, Component, Label, Node } from "cc";
|
||||
import {
|
||||
_decorator,
|
||||
Component,
|
||||
Label,
|
||||
Node,
|
||||
Sprite,
|
||||
tween,
|
||||
UIOpacity,
|
||||
} from "cc";
|
||||
import { ChatController } from "../../core/ChatController";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PayToTalkSubpanel")
|
||||
@@ -14,15 +23,38 @@ export class PayToTalkSubpanel extends Component {
|
||||
@property(Label)
|
||||
vipBtnLabel: Label = null;
|
||||
|
||||
base: UIOpacity;
|
||||
|
||||
protected onLoad(): void {
|
||||
this.base = this.getComponent(UIOpacity);
|
||||
}
|
||||
|
||||
show() {}
|
||||
show() {
|
||||
this.node.active = true;
|
||||
this.base.opacity = 0;
|
||||
tween(this.base).to(0.3, { opacity: 255 }).start();
|
||||
}
|
||||
|
||||
hide() {
|
||||
tween(this.base)
|
||||
.to(
|
||||
0.3,
|
||||
{ opacity: 0 },
|
||||
{
|
||||
onComplete: () => {
|
||||
this.base.node.active = false;
|
||||
},
|
||||
}
|
||||
)
|
||||
.start();
|
||||
}
|
||||
|
||||
refresh() {}
|
||||
|
||||
onClick_BuyTime() {
|
||||
//购买次数
|
||||
console.log("购买聊天次数,未实现功能");
|
||||
ChatController.Instance.resetChatCount();
|
||||
this.hide();
|
||||
}
|
||||
|
||||
onClick_BuyVip() {
|
||||
|
||||
Reference in New Issue
Block a user