Removing temporary PlayerList component, removing TMPro from asmdef

This commit is contained in:
Jason Durand 2022-06-01 15:54:00 -04:00
parent a8d7a8e92c
commit 8c5af9e121
3 changed files with 1 additions and 48 deletions

View File

@ -1,35 +0,0 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class PlayerList : MonoBehaviour {
HashSet<int> playerIds = new();
TMP_Text text;
void Awake() {
text = GetComponent<TMP_Text>();
text.text = "";
}
public void SetPlayerList(IEnumerable<int> ids) {
playerIds.Clear();
foreach (int id in ids)
playerIds.Add(id);
}
public void Connected(int id) {
playerIds.Add(id);
UpdateList();
}
public void Disconnected(int id) {
playerIds.Remove(id);
UpdateList();
}
void UpdateList() {
text.text = "";
foreach (int playerId in playerIds)
text.text += $"Player #{playerId}\n";
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8f4454c6a8ff1f5478829232f04817a5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,8 +2,7 @@
"name": "Squelette", "name": "Squelette",
"rootNamespace": "Squelette", "rootNamespace": "Squelette",
"references": [ "references": [
"GUID:f2ae9fe63a6bc0544986e5b17cf9a8a5", "GUID:f2ae9fe63a6bc0544986e5b17cf9a8a5"
"GUID:6055be8ebefd69e48b49212b09b47b2f"
], ],
"includePlatforms": [], "includePlatforms": [],
"excludePlatforms": [], "excludePlatforms": [],