Add deleteObject
This commit is contained in:
parent
ec550ea093
commit
22ce0fd58f
3 changed files with 18 additions and 2 deletions
|
@ -12,5 +12,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
public class UpdateGameObjectDeleted : UpdateData
|
public class UpdateGameObjectDeleted : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; }
|
public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; }
|
||||||
|
public string GameObjectType;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,6 +13,8 @@ public class Collectable : Interactable
|
||||||
|
|
||||||
public override void OnInteraction(object sender, CollisionComponent e)
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot());
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,6 +141,19 @@ namespace ZoFo.GameCore
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Удаляет игровой объект
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="gameObject"></param>
|
||||||
|
public void DeleteObject(GameObject gameObject)
|
||||||
|
{
|
||||||
|
gameObjects.Remove(gameObject);
|
||||||
|
AddData(new UpdateGameObjectDeleted()
|
||||||
|
{ GameObjectType = gameObject.GetType().Name}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue