using System.Collections.Generic; namespace GFGGame { public class GetSuitItemController { public static bool enable = true; private static List _waitingToShowList = new List(); public static void AddItemId(int itemId) { if (!enable || GameGlobal.myUnit == null) { return; } _waitingToShowList.Add(itemId); } public static int TryShow(int itemId) { if (itemId > 0) { int index = _waitingToShowList.IndexOf(itemId); if (index >= 0) { _waitingToShowList.RemoveAt(index); ViewManager.Show(ViewName.GET_SUIT_ITEM_VIEW, itemId); } } else if (_waitingToShowList.Count > 0) { itemId = _waitingToShowList[0]; _waitingToShowList.RemoveAt(0); ViewManager.Show(ViewName.GET_SUIT_ITEM_VIEW, itemId); } return itemId; } } }