// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const { ccclass, property } = cc._decorator;
@ccclass
export default class Ui extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
@property({
type: cc.Node
})
dialog: cc.Node = null;
@property({
type: cc.Button
})
btnScale: cc.Button = null;
@property({
type: cc.Button
})
btnMove: cc.Button = null;
scaleClickCount: number = 0;
moveClickCount: number = 0;
// LIFE-CYCLE CALLBACKS:
onLoad() {
let LEFT_TO_RIGHT: string = &#
cocos监听按钮,监听动画结束
最新推荐文章于 2022-07-21 14:19:05 发布
本文详细介绍了在 Cocos2d-x 游戏开发中如何监听按钮点击事件以及动画执行完毕后的回调处理。通过设置事件监听器,可以精确控制游戏交互逻辑;同时,利用动画结束回调,可以实现更流畅的游戏状态转换。
摘要由CSDN通过智能技术生成