43 lines
1001 B
TypeScript
43 lines
1001 B
TypeScript
import { _decorator, Button, Component, Node, RichText } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('FeedManager')
|
|
export class FeedManager extends Component {
|
|
|
|
//取消按钮
|
|
@property(Button)
|
|
public cancelBtn: Button = null;
|
|
//确认按钮
|
|
@property(Button)
|
|
public confirmBtn: Button = null;
|
|
//设置文本字体颜色为黑色
|
|
@property
|
|
public textColor: string = '#000000';
|
|
public richText: RichText;
|
|
|
|
start() {
|
|
|
|
//this.richText.string = "<color="+this.textColor+">"+this.richText.string+"</color>";
|
|
//监听按钮事件
|
|
this.cancelBtn.node.on('click', this.cancel, this);
|
|
this.confirmBtn.node.on('click', this.confirm, this);
|
|
}
|
|
|
|
//取消
|
|
public cancel() {
|
|
console.log('取消');
|
|
}
|
|
//确认
|
|
public confirm() {
|
|
console.log('确认');
|
|
//隐藏当前界面
|
|
this.node.active = false;
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
}
|
|
|
|
|