Mapping and models

This commit is contained in:
Marco 2025-06-22 13:52:23 +02:00
commit 595444885d
21 changed files with 4674 additions and 843 deletions

View file

@ -0,0 +1,11 @@
using Cirno.Scripts.Resources;
using Godot;
namespace Cirno.Scripts.Controllers;
[GlobalClass]
public partial class PooledBulletInfo : Resource
{
[Export] public BulletResource Bullet { get; private set; }
[Export] public int Amount { get; private set; }
}

View file

@ -0,0 +1 @@
uid://e3jqtie5u2wp

View file

@ -25,6 +25,18 @@ public partial class PoolingManager : Node
public override void _Ready()
{
Instance = this;
}
private void SpawnInitialBullets()
{
foreach (var bulletInfo in PoolOnStart)
{
for (int i = 0; i < bulletInfo.Amount; i++)
{
SpawnBullet(bulletInfo.Bullet, false);
}
}
}
public IBullet SpawnBullet(BulletResource bulletResource, bool active = true)
@ -130,10 +142,4 @@ public partial class PoolingManager : Node
return bullet as IBullet;
}
}
public partial class PooledBulletInfo : Resource
{
public BulletResource Bullet { get; private set; }
public int Amount { get; private set; }
}