updates sets position on client

This commit is contained in:
SergoDobro 2024-08-17 23:48:39 +03:00
parent 6afd91b0b7
commit 0f6937dbf4
2 changed files with 5 additions and 3 deletions

View file

@ -93,9 +93,9 @@ namespace ZoFo.GameCore
else if (update is UpdateGameObjectCreated)
{
if ((update as UpdateGameObjectCreated).GameObjectType == "EntittyForAnimationTests")
gameObjects.Add(new EntittyForAnimationTests(new Vector2(100, 100)));
gameObjects.Add(new EntittyForAnimationTests((update as UpdateGameObjectCreated).position));
if ((update as UpdateGameObjectCreated).GameObjectType == "Player")
gameObjects.Add(new Player(new Vector2(500, 100)));
gameObjects.Add(new Player((update as UpdateGameObjectCreated).position));
(gameObjects.Last() as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity);
//var a = Assembly.GetAssembly(typeof(GameObject));

View file

@ -1,4 +1,5 @@
using System;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -14,5 +15,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; }
public string GameObjectType;
public string GameObjectId;
public Vector2 position;
}
}