summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs')
-rw-r--r--Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs b/Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs
new file mode 100644
index 00000000..3053179d
--- /dev/null
+++ b/Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs
@@ -0,0 +1,34 @@
+#if UNITY_EDITOR
+using System;
+using System.Collections.Generic;
+using XUtliPoolLib;
+
+namespace XEditor
+{
+ internal class XBulletMgr : XSingleton<XBulletMgr>
+ {
+ private List<XBullet> _bullets = new List<XBullet>();
+
+ public void ShootBullet(XBullet bullet)
+ {
+ _bullets.Add(bullet);
+ }
+
+ public void Update(float fDeltaT)
+ {
+ int len = _bullets.Count;
+
+ for (int i = len - 1; i >= 0; i--)
+ {
+ if(_bullets[i].IsExpired())
+ {
+ _bullets[i].Destroy();
+ _bullets.RemoveAt(i);
+ }
+ else
+ _bullets[i].Update(fDeltaT);
+ }
+ }
+ }
+}
+#endif \ No newline at end of file