//==测试代码=========== private void TimeOutReborn() { GameObject go = new GameObject(); go.transform.DOMoveX(0.1f, 3.0f) .OnComplete(new TweenCallback(() => { GameObject.Destroy(go); BattleProtocol.GetInstance().SendRebornBattle(BattleId);; })); }
//发送操作指令 private void SendMoveCommond(MOVE_DIR dir) { uint battleId = ZTBattleSceneManager.GetInstance().MyPlayer.BattleId; if (_moveDir != dir && battleId > 0 && ZTBattleSceneManager.GetInstance().MyPlayer.MoveDir != dir) { _moveDir = dir; BattleProtocol.GetInstance().SendMoveComand(battleId, dir); //MoveCommand command = FightDefine.GetMoveCommand(battleId, dir); //SceneEvent.GetInstance().dispatchEvent(SCENE_EVENT.ADD_COMMAND, new Notification(command)); } }
private void Test() { BattleProtocol.GetInstance().Init(); //SceneEvent.GetInstance().dispatchEvent(SCENE_EVENT.ADD_PLAYER, new Notification(1, this.gameObject)); //SceneEvent.GetInstance().dispatchEvent(SCENE_EVENT.ADD_PLAYER, new Notification(2, this.gameObject)); if (NetWorkConst.IsOpenNetWork) { BattleProtocol.GetInstance().SendEnterBattle(PlayerModule.GetInstance().RoleID, PlayerModule.GetInstance().RoleJob); } else { /* * PlayerModule.GetInstance().SetRoleInfo(new gprotocol.p_role() * { * id = 1, * job = 1 * }); */ BattleProtocol.GetInstance().SendEnterBattle(1, 1); BattleProtocol.GetInstance().SendEnterBattle(2, 1); } }