feat jenkins cicd
This commit is contained in:
@@ -7,7 +7,7 @@ public class PlayerManager : MonoBehaviour
|
||||
public GameObject playerPrefab;
|
||||
public Transform playerScene;
|
||||
|
||||
private Dictionary<int, PlayerMove> _players = new();
|
||||
private Dictionary<long, PlayerMove> _players = new();
|
||||
|
||||
public static PlayerManager Instance { get; private set; }
|
||||
|
||||
@@ -32,10 +32,10 @@ public class PlayerManager : MonoBehaviour
|
||||
private GameObject AddPlayer(PositionInfo info)
|
||||
{
|
||||
var player = Instantiate(playerPrefab, playerScene);
|
||||
player.GetComponent<PlayerInfo>().uid = info.UID;
|
||||
player.GetComponent<PlayerInfo>().usn = info.USN;
|
||||
var move = player.GetComponent<PlayerMove>();
|
||||
move.SetPosition(info.X, info.Y);
|
||||
_players.Add(info.UID, move);
|
||||
_players.Add(info.USN, move);
|
||||
return player;
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ public class PlayerManager : MonoBehaviour
|
||||
var position = S2C_Position.Parser.ParseFrom(msg);
|
||||
foreach (var info in position.Info)
|
||||
{
|
||||
if (!_players.ContainsKey(info.UID))
|
||||
if (!_players.ContainsKey(info.USN))
|
||||
{
|
||||
AddPlayer(info);
|
||||
}
|
||||
else
|
||||
{
|
||||
_players[info.UID].SetPosition(info.X, info.Y);
|
||||
_players[info.USN].SetPosition(info.X, info.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user