You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Babushka/scripts/CSharp/GameEntity/EntityPlacer/TrashEntityPlacer.cs

26 lines
838 B

using Babushka.scripts.CSharp.GameEntity.Entities;
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.EntityPlacer;
public partial class TrashEntityPlacer : Node2D
{
private string _trashEntityType = TrashEntity.OWN_TYPE_NAME;
public override void _Ready()
{
string sceneName = EntityManager.Instance.CurrentEntitySceneContainer!.sceneName;
var loadedScenesEntity = EntityManager.Instance.GetUniqueEntity<LoadedScenesEntity>();
if (!loadedScenesEntity.WasSceneLoaded(sceneName))
{
TrashEntity entity = new TrashEntity();
entity.sceneName = sceneName;
entity.position = GlobalPosition;
EntityManager.Instance.AddEntity(entity);
}
QueueFree();
}
}