Ejemplo n.º 1
0
        static void AddUIToStack(UIWithInput ui)
        {
            if (uiStack.Count == 0)
            {
                UIInput.MarkAllSelectionAxesOccupied();
                inputModule.gameObject.SetActive(true);
            }
            else
            {
                if (uiStack.Contains(ui))
                {
                    Debug.LogError("Adding duplicate ui: " + ui.name);
                }
                for (int i = 0; i < uiStack.Count; i++)
                {
                    uiStack[i].SetSelectablesActive(false);
                    if (i == uiStack.Count - 1)
                    {
                        UIInput.MarkActionsUnoccupied(uiStack[i].GetUsedActions());
                    }
                }
            }

            UIInput.MarkActionsOccupied(ui.GetUsedActions());
            ui.SetSelectablesActive(true);
            uiStack.Add(ui);
        }
Ejemplo n.º 2
0
        static void RemoveUIFromStack(UIWithInput ui)
        {
            bool wasTop = UIIsLastInStack(ui);

            uiStack.Remove(ui);
            if (wasTop)
            {
                UIInput.MarkActionsUnoccupied(ui.GetUsedActions());

                if (uiStack.Count > 0)
                {
                    UIWithInput newTop = uiStack[uiStack.Count - 1];
                    UIInput.MarkActionsOccupied(newTop.GetUsedActions());
                    newTop.SetSelectablesActive(true);
                }
            }
        }