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/VesnaEntityPlacer.cs

22 lines
623 B

using Babushka.scripts.CSharp.GameEntity.Entities;
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.EntityPlacer;
public partial class VesnaEntityPlacer : Node2D
{
public override void _Ready()
{
var sceneName = EntityManager.Instance.CurrentEntitySceneContainer!.sceneName;
var entity = EntityManager.Instance.GetUniqueEntity<VesnaEntity>();
if (entity.sceneName != sceneName)
{
entity.position = GlobalPosition;
entity.sceneName = sceneName;
}
QueueFree();
}
}