add onAddPlayer event

This commit is contained in:
Mister_Nebula 2021-08-28 21:53:35 +01:00
parent d9eba599f9
commit 5c0ba4574b

View File

@ -35,6 +35,7 @@ namespace QSB.Player
}
public static Action<uint> OnRemovePlayer;
public static Action<uint> OnAddPlayer;
public static PlayerInfo LocalPlayer => GetPlayer(LocalPlayerId);
public static List<PlayerInfo> PlayerList { get; } = new List<PlayerInfo>();
@ -69,6 +70,7 @@ namespace QSB.Player
DebugLog.DebugWrite($"Create Player : id<{id}> Stacktrace :\r\n{Environment.StackTrace}", MessageType.Info);
player = new PlayerInfo(id);
PlayerList.Add(player);
OnAddPlayer?.Invoke(id);
return player;
}