void Update() { if (checkPlayers.CheckAndRun()) { GameMgrRouter.FightSystemRequestCall(FightSystemKeys.QUERY_PLAYERS_HP, roomID, ""); } totalPlayerCount.val = characters.Count; }
public void PlayerAttacked(object obj) { try { if (obj is RoleHurtEvent roleEvent && characters.ContainsKey(roleEvent.hittedUserID)) { // [1] 直接扣血 // characters[roleEvent.userID].Hit(roleEvent.hurtHP); // [2] 服务端决定扣血 回调 CheckerPlayersHP //Debug.Log(roleEvent.attackUserID + " attack " + roleEvent.hittedUserID + " hp " + roleEvent.hurtHP); GameMgrRouter.FightSystemRequestCall(FightSystemKeys.ATTACKED, roomID, string.Format("{0},{1},{2}", roleEvent.attackUserID, roleEvent.hittedUserID, roleEvent.hurtHP)); } } catch (Exception) { } }