mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-13 20:45:53 +00:00
Bullets pooling
This commit is contained in:
parent
37bcf8b2d0
commit
fa3805ecfe
18 changed files with 280 additions and 69 deletions
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Controllers;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Godot.Collections;
|
||||
|
||||
|
|
@ -78,7 +79,11 @@ public partial class Barrel : Area2D, IDestructible
|
|||
{
|
||||
if (ExplosionData == null) return;
|
||||
|
||||
var explosion = this.CreateSibling<Bullet>(ExplosionData.BulletScene);
|
||||
|
||||
var explosion = PoolingManager.Instance.SpawnBullet(ExplosionData);
|
||||
explosion.GlobalPosition = this.GlobalPosition;
|
||||
|
||||
//var explosion = this.CreateSibling<Bullet>(ExplosionData.BulletScene);
|
||||
explosion.Speed = 0;
|
||||
|
||||
explosion.Initialize(ExplosionData.MakeBullet(this.GlobalPosition), _gameManager);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue