public static Unsubscribe ( DataType, dataType, int id ) : void | ||
dataType | DataType, | |
id | int | |
return | void |
void died(JSONClass packet) { if (GameData.LobbyData[playerID].TeamID == GameData.MyPlayer.TeamID) { GameData.EnemyTeamKillCount++; } else { GameData.AllyTeamKillCount++; } NetworkingManager.Unsubscribe(DataType.Player, playerID); GameData.PlayerPosition.Remove(playerID); Destroy(gameObject); if (playerID == GameData.AllyKingID) { GameManager.instance.GameLost(); } if (playerID == GameData.EnemyKingID) { GameManager.instance.GameWon(); } }
void took_damage(JSONClass packet) { baseClass.ClassStat.CurrentHp = packet["NewHP"].AsFloat; GameManager.instance.PlayerTookDamage(playerID, packet["NewHP"].AsFloat, baseClass.ClassStat); if (baseClass.ClassStat.CurrentHp <= 0.0f) { NetworkingManager.Unsubscribe(DataType.Player, playerID); GameData.PlayerPosition.Remove(playerID); Destroy(gameObject); } }