import { _decorator, Component, Node, Sprite } from 'cc'; import { ClientEvent } from '../clientEvent'; import { Constant } from '../constant'; import { ResMng } from '../gcommon/ResMng'; import { UIButton } from '../gcommon/UIButton'; import { msgManager } from '../socket/msgManager'; const { ccclass, property } = _decorator; @ccclass('emote') export class emote extends Component { emote_index:number = 0; id:string = ""; start() { UIButton.BindClick(this.node,()=>{ console.log("emote_index",this.emote_index) msgManager.send_chat(this.id,"") // ClientEvent.dispatchEvent(Constant.UI_EVENT.UI_MSG_SHOW_SELF_EMOTE,this.emote_index) // ClientEvent.dispatchEvent(Constant.UI_EVENT.UI_MSG_SHOW_RIVAL_EMOTE,this.emote_index) ClientEvent.dispatchEvent(Constant.UI_EVENT.UI_MSG_BTN_HIDE_CHAT) },this) } update(deltaTime: number) { } show(id:string,index:number){ console.log("emote",index) this.id = id; this.emote_index = index; ResMng.LoadEmote("Game_Images_chat_emote_exp_"+index,this.node.getComponent(Sprite)) } }