From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/BarrageQueue.cs | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/BarrageQueue.cs (limited to 'Client/Assets/Scripts/XMainClient/BarrageQueue.cs') diff --git a/Client/Assets/Scripts/XMainClient/BarrageQueue.cs b/Client/Assets/Scripts/XMainClient/BarrageQueue.cs new file mode 100644 index 00000000..be8b570d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/BarrageQueue.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; + +namespace XMainClient +{ + internal class BarrageQueue + { + public int queueCnt + { + get + { + return this.mItems.Count; + } + } + + public int depth = 1; + + private List mItems = new List(); + + public void Fire(BarrageItem item, string txt, bool outline) + { + this.mItems.Add(item); + item.Make(txt, this, outline); + this.depth++; + } + + public bool FadeOut(BarrageItem item) + { + bool flag = this.mItems.Contains(item); + bool result; + if (flag) + { + this.mItems.Remove(item); + result = true; + } + else + { + result = false; + } + return result; + } + + public void ForceClear() + { + for (int i = 0; i < this.mItems.Count; i++) + { + bool flag = this.mItems[i] != null && this.mItems[i].gameObject != null; + if (flag) + { + this.mItems[i].Drop(); + } + } + this.mItems.Clear(); + this.depth = 1; + } + } +} -- cgit v1.1-26-g67d0