Merge branch 'DevelopmentX' of github.com:progtime-net/ZoFo into DevelopmentX

This commit is contained in:
SergoDobro 2024-08-20 17:55:00 +03:00
commit e9150c1717
5 changed files with 11 additions and 3 deletions

View file

@ -197,6 +197,7 @@ namespace ZoFo.GameCore
}
else if (update is UpdateGameObjectCreated)
{
//TODO
Entity created_gameObject;
if ((update as UpdateGameObjectCreated).GameObjectType == "Player")
{

View file

@ -12,6 +12,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
public class UpdateGameObjectDeleted : UpdateData
{
public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; isImportant = false; }
public string GameObjectType;
public string GameObjectType { get; set; }
}
}

View file

@ -59,7 +59,10 @@ namespace ZoFo.GameCore.GameObjects
public virtual void Delete()
{
AppManager.Instance.server.DeleteObject(this);
if (AppManager.Instance.gamestate == GameState.HostPlaying)
{
AppManager.Instance.server.DeleteObject(this);
}
}
}
}

View file

@ -44,7 +44,10 @@ public abstract class GameObject
public void Instantiate(GameObject gameObject)
{
AppManager.Instance.server.RegisterGameObject(gameObject);
if (AppManager.Instance.gamestate == GameState.HostPlaying)
{
AppManager.Instance.server.RegisterGameObject(gameObject);
}
}
#endregion

View file

@ -123,6 +123,7 @@ namespace ZoFo.GameCore
networkManager.StartGame();
new MapManager().LoadMap();
//TODO
//AppManager.Instance.server.RegisterGameObject(new EntittyForAnimationTests(new Vector2(0, 0)));
AppManager.Instance.server.RegisterGameObject(new Player(new Vector2(760, 140)));
//for (int i = 0; i < 20; i++)