Level Data decentralization
This commit is contained in:
parent
76b33db91f
commit
e3613b132e
12 changed files with 52 additions and 28 deletions
|
|
@ -13,7 +13,7 @@ public partial class PlantSunSpawner : Node2D
|
|||
var sun = _sunScene.Instantiate<Sun>();
|
||||
sun.amount = _amountPerSun;
|
||||
|
||||
LevelController.Instance.Pools.Projectiles.AddChild(sun);
|
||||
PoolContainer.Instance.Projectiles.AddChild(sun);
|
||||
sun.GlobalPosition = GlobalPosition;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public partial class RuntimePlantData : Node2D, IEntity
|
|||
}
|
||||
public void Kill()
|
||||
{
|
||||
LevelController.Instance.Pools.EntityField[Resource.Layer].Remove(GlobalPosition);
|
||||
PoolContainer.Instance.EntityField[Resource.Layer].Remove(GlobalPosition);
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public partial class Shooter : Node2D
|
|||
|
||||
_timer.Start();
|
||||
var instance = _projectile.Instantiate<Node2D>();
|
||||
LevelController.Instance.Pools.Projectiles.AddChild(instance);
|
||||
PoolContainer.Instance.Projectiles.AddChild(instance);
|
||||
instance.GlobalTransform = GlobalTransform;
|
||||
|
||||
if (instance is IProjectile projectile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue