mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Mapping and models
This commit is contained in:
parent
bd7f04d6fe
commit
595444885d
21 changed files with 4674 additions and 843 deletions
11
Scripts/Controllers/PooledBulletInfo.cs
Normal file
11
Scripts/Controllers/PooledBulletInfo.cs
Normal 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; }
|
||||
}
|
||||
1
Scripts/Controllers/PooledBulletInfo.cs.uid
Normal file
1
Scripts/Controllers/PooledBulletInfo.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://e3jqtie5u2wp
|
||||
|
|
@ -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; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue