SettingmultiplyPlayers in solo
This commit is contained in:
parent
4dc18ea64e
commit
29a7648e5b
3 changed files with 13 additions and 5 deletions
|
@ -47,12 +47,15 @@ namespace ZoFo.GameCore
|
|||
// Отправляются данные апдейтса с обновлением инпута
|
||||
AppManager.Instance.InputManager.ActionEvent += () =>
|
||||
{
|
||||
networkManager.AddData(new UpdateInput()
|
||||
if (AppManager.Instance.client.networkManager.PlayerId > 0)
|
||||
{
|
||||
InputMovementDirection = AppManager.Instance.InputManager.InputMovementDirection.Serialize(),
|
||||
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection.Serialize(),
|
||||
PlayerId = AppManager.Instance.client.networkManager.PlayerId
|
||||
});
|
||||
networkManager.AddData(new UpdateInput()
|
||||
{
|
||||
InputMovementDirection = AppManager.Instance.InputManager.InputMovementDirection.Serialize(),
|
||||
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection.Serialize(),
|
||||
PlayerId = AppManager.Instance.client.networkManager.PlayerId
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
AppManager.Instance.InputManager.OnInteract += () =>
|
||||
|
|
|
@ -170,6 +170,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
update = token.ToObject<UpdateTileCreated>();
|
||||
data.Add(update);
|
||||
break;
|
||||
case "UpdateCreatePlayer":
|
||||
update = token.ToObject<UpdateCreatePlayer>();
|
||||
data.Add(update);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
|
|||
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
||||
[JsonDerivedType(typeof(UpdateInputInteraction))]
|
||||
[JsonDerivedType(typeof(UpdateInputShoot))]
|
||||
[JsonDerivedType(typeof(UpdateCreatePlayer))]
|
||||
|
||||
public class UpdateData
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue