public void PopTopElement()
        {
            GameObjectStack stack = FindStack();

            if (stack == null)
            {
                return;
            }

            if (all)
            {
                while (stack.stack.Count > 0)
                {
                    stack.PopTopElement();
                }
            }
            else
            {
                stack.PopTopElement();
            }
        }
示例#2
0
        public void HandleCloseButtonClicked()
        {
            GameObjectStackElement element = GetComponentInParent <GameObjectStackElement>();

            GameObjectStack stack = element.GetComponentInParent <GameObjectStack>();

            if (stack.stack.Count > 0 && stack.stack[stack.stack.Count - 1] == element)
            {
                stack.PopTopElement();
                if (onCloseClicked != null)
                {
                    onCloseClicked.Invoke();
                }
            }
        }
示例#3
0
        public void PushElement()
        {
            GameObjectStack stack = FindStack();

            if (stack == null)
            {
                return;
            }

            if (popFirst)
            {
                stack.PopTopElement();
            }
            stack.SpawnObject(prefab);
        }