1234567891011121314151617181920212223242526272829 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Sirenix.OdinInspector;
- namespace KairoEngine.Multiplayer
- {
- [System.Serializable]
- public class ClientData
- {
- [FoldoutGroup("@ToString()")] public int connectionId = -1;
- [FoldoutGroup("@ToString()")] public string playerName = "";
- [FoldoutGroup("@ToString()")] public bool isConnected = false;
- public ClientData(int connectionId, string playerName, bool isConnected)
- {
- this.connectionId = connectionId;
- this.playerName = playerName;
- this.isConnected = isConnected;
- }
- public override string ToString()
- {
- string idText = connectionId < 10 ? $"0{connectionId.ToString()}" : $"{connectionId}";
- if(!isConnected) idText = "XX";
- return $"{idText} : {playerName}";
- }
- }
- }
|