StopObjectCreatedCommit

This commit is contained in:
AnloGames 2024-08-20 12:17:53 +03:00
parent f7688a7785
commit e57291cb4c
5 changed files with 11 additions and 7 deletions

View file

@ -216,10 +216,10 @@ namespace ZoFo.GameCore
(gameObjects.Last() as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity); (gameObjects.Last() as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity);
} }
else if (update is UpdateGameOBjectWithoutIdCreated) else if (update is UpdateGameObjectWithoutIdCreated)
{ {
Type t = Type.GetType("ZoFo.GameCore.GameObjects." + (update as UpdateGameOBjectWithoutIdCreated).GameObjectClassName); Type t = Type.GetType("ZoFo.GameCore.GameObjects." + (update as UpdateGameObjectWithoutIdCreated).GameObjectClassName);
GameObject gameObject = Activator.CreateInstance(t, (update as UpdateGameOBjectWithoutIdCreated).position.GetVector2()) as GameObject; GameObject gameObject = Activator.CreateInstance(t, (update as UpdateGameObjectWithoutIdCreated).position.GetVector2()) as GameObject;
if (gameObject is Particle) if (gameObject is Particle)
particles.Add(gameObject as Particle); particles.Add(gameObject as Particle);
} }

View file

@ -145,6 +145,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
update = token.ToObject<UpdateInteraction>(); update = token.ToObject<UpdateInteraction>();
data.Add(update); data.Add(update);
break; break;
case "UpdateStopObjectCreated":
update = token.ToObject<UpdateStopObjectCreated>();
data.Add(update);
break;
case "UpdateInteractionReady": case "UpdateInteractionReady":
update = token.ToObject<UpdateInteractionReady>(); update = token.ToObject<UpdateInteractionReady>();
data.Add(update); data.Add(update);

View file

@ -7,9 +7,9 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
/// <summary> /// <summary>
/// Хранит новое сосотяние анимации /// Хранит новое сосотяние анимации
/// </summary> /// </summary>
public class UpdateGameOBjectWithoutIdCreated : UpdateData public class UpdateGameObjectWithoutIdCreated : UpdateData
{ {
public UpdateGameOBjectWithoutIdCreated() { UpdateType = "UpdateGameOBjectWithoutIdCreated"; } public UpdateGameObjectWithoutIdCreated() { UpdateType = "UpdateGameObjectWithoutIdCreated"; }
public string GameObjectClassName { get; set; } public string GameObjectClassName { get; set; }
public SerializableVector2 position { get; set; } public SerializableVector2 position { get; set; }
} }

View file

@ -18,7 +18,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
[JsonDerivedType(typeof(UpdateInteraction))] [JsonDerivedType(typeof(UpdateInteraction))]
[JsonDerivedType(typeof(UpdateInteractionReady))] [JsonDerivedType(typeof(UpdateInteractionReady))]
[JsonDerivedType(typeof(UpdateLoot))] [JsonDerivedType(typeof(UpdateLoot))]
[JsonDerivedType(typeof(UpdateGameOBjectWithoutIdCreated))] [JsonDerivedType(typeof(UpdateGameObjectWithoutIdCreated))]
[JsonDerivedType(typeof(UpdatePlayerParametrs))] [JsonDerivedType(typeof(UpdatePlayerParametrs))]
[JsonDerivedType(typeof(UpdatePosition))] [JsonDerivedType(typeof(UpdatePosition))]
[JsonDerivedType(typeof(UpdateStopObjectCreated))] [JsonDerivedType(typeof(UpdateStopObjectCreated))]

View file

@ -215,7 +215,7 @@ namespace ZoFo.GameCore
if (gameObject is Particle) if (gameObject is Particle)
{ {
AddData(new UpdateGameOBjectWithoutIdCreated() AddData(new UpdateGameObjectWithoutIdCreated()
{ {
GameObjectClassName = gameObject.GetType().Name, GameObjectClassName = gameObject.GetType().Name,
position = gameObject.position.Serialize() position = gameObject.position.Serialize()