void InitUpdate() { EventCenter instance = isLocalPlayer ? EventCenter.localPlayer : EventCenter.anotherPlayer; instance.AddEventListener("offTheGround", offTheGround); instance.AddEventListener("onTheGround", onTheGround); instance.AddEventListener <int>("Hurt", Hurt); instance.AddEventListener <int>("turnAround", turnAround); instance.AddEventListener <Vector2>("ScreenMove", ScreenMove); GameMgr.instance.RemoveFristUpdateEventListener(InitUpdate); }
// 注册监听事件 public void RegistListener() { EventCenter.AddEventListener <Session, GameMessage>(Protocol.HurtBeat, MsgHeartBeat); EventCenter.AddEventListener <Session, GameMessage>(Protocol.Regist, MsgRegister); EventCenter.AddEventListener <Session, GameMessage>(Protocol.Login, MsgLogin); EventCenter.AddEventListener <Session, GameMessage>(Protocol.Logout, MsgLogout); }
public override void Enter() { base.Enter(); OwnerFSM.gameObject.GetComponent <PlayerAmination>().UpdateAnimatin(false); EventCenter instance = OwnerFSM.isLocalPlayer ? EventCenter.localPlayer : EventCenter.anotherPlayer; instance.AddEventListener("onTheGround", ToIdleState); }
public void RegistListener() { EventCenter.AddEventListener <Session, GameMessage>(Protocol.GetRoomList, MsgGetRoomList); EventCenter.AddEventListener <Session, GameMessage>(Protocol.CreateRoom, MsgCreateRoom); EventCenter.AddEventListener <Session, GameMessage>(Protocol.EnterRoom, MsgEnterRoom); EventCenter.AddEventListener <Session, GameMessage>(Protocol.GetRoomInfo, MsgGetRoomInfo); EventCenter.AddEventListener <Session, GameMessage>(Protocol.LeaveRoom, MsgLeaveRoom); }
public void RegistListener() { EventCenter.AddEventListener <Session, GameMessage>(Protocol.StarFight, MsgStartFight); EventCenter.AddEventListener <Session, GameMessage>(Protocol.UpdateUnitInfo, MsgUpdateUnitInfo); EventCenter.AddEventListener <Session, GameMessage>(Protocol.Shooting, MsgShooting); EventCenter.AddEventListener <Session, GameMessage>(Protocol.Reload, MsgReload); EventCenter.AddEventListener <Session, GameMessage>(Protocol.Hit, MsgHit); EventCenter.AddEventListener <Session, GameMessage>(Protocol.FightComplete, MsgCompleteFight); }
public override void OnShowing() { base.OnShowing(); InitUI(); // 设置鼠标不可见,并且锁定在游戏中 Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; // 注册事件 EventCenter.AddEventListener <string, string>(EventID.UpdateBattleText, UpdateBattleText); EventCenter.AddEventListener(EventID.ShowKillImg, ShowKillImg); }
// 注册监听事件 public void RegistListener() { EventCenter.AddEventListener <Session, GameMessage>(Protocol.GetAchieve, MsgGetAchieve); }
public void RegistListener() { EventCenter.AddEventListener <Player, BattleCommand>(Protocol.CmdReady, CmdReady); }