diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs')
-rw-r--r-- | Client/Assets/Scripts/XEditor/XSkillEditor/XBulletMgr.cs | 34 |
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 |