示例#1
0
        public void OpenNotAnimated(WooPanel panel, bool notify = true, WooPanel target = null)
        {
            if (IsOpen(panel) || !CanBeOpened(panel))
            {
                return;
            }
            if (panel == null)
            {
                return;
            }
            RebuildIfPanelGameObjectIsNull(panel);
            panel.gameObject.SetActive(true);

            ProcessAlwaysOnTop(panel);
            TryOpeningParents(panel, true, notify, target);
            CloseSameLevelPanels(panel, true, notify);

            panelNodes[panel].IsOpening = true;
            RewindToEndPanelAnimation(panel);
            SamplePanelAnimator(panel);

            panelNodes[panel].IsOpen = true;

            if (notify)
            {
                panel.NotifyOpeningBegin();
            }

            TryOpeningChildren(panel, true, target);

            if (notify)
            {
                panel.NotifyOpeningEnd();
            }
        }
示例#2
0
        public void PlayOpenAnimationImmdiately(WooPanel panel, bool notify = true)
        {
            panel.gameObject.SetActive(true);

            panelNodes[panel].StopCoroutines();

            panel.PanelState = PanelState.IsOpening;
            if (notify)
            {
                panel.NotifyOpeningBegin();
            }

            panel.PanelState = PanelState.Opened;

            if (notify)
            {
                panel.NotifyOpeningEnd();
            }
            ProcessAlwaysOnTop(panel);

            panel.PanelState = PanelState.IsOpening;
            RewindToEndPanelAnimation(panel);
            SamplePanelAnimator(panel);
            panel.PanelState = PanelState.Opened;
        }
示例#3
0
        public void OpenAnimated(WooPanel panel, bool notify = true, WooPanel target = null)
        {
            if (IsOpen(panel) || panelNodes[panel].IsOpening || panelNodes[panel].IsWaitingToOpen || !CanBeOpened(panel))
            {
                return;
            }

            RebuildIfPanelGameObjectIsNull(panel);

            MakeTreeActive(panel);

            panelNodes[panel].StopCoroutines();
            panelNodes[panel].IsWaitingToOpen = true;
            RewindPanelAnimation(panel);

            CloseSameLevelPanels(panel, false, notify);
            var parent = GetParent(panel) != null?GetParent(panel).Panel : null;


            var timeToOpen = panelNodes[panel].TimeToOpen();

            var timeToCloseSameLevel = TimeForSameLevelToClose(panel) * panel.PanelProperties.SiblingsToClose;

            var timeToOpenParents = 0.0f;

            if (parent != null)
            {
                timeToOpenParents = TimeToStartOpening(parent) + panelNodes[parent].TimeToOpen() * panel.PanelProperties.ParentToOpen;
            }
            panelNodes[panel].waitingTime          = timeToCloseSameLevel + timeToOpenParents;
            panelNodes[panel].remainingWaitingTime = timeToCloseSameLevel + timeToOpenParents;

            panelNodes[panel].ForceMirrored = true;
            panelNodes[panel].Invoke(timeToCloseSameLevel, () =>
            {
                ProcessAlwaysOnTop(panel);

                TryOpeningParents(panel, false, notify, target);

                panelNodes[panel].Invoke(timeToOpenParents, () =>
                {
                    panelNodes[panel].IsOpening = true;

                    if (notify)
                    {
                        panel.NotifyOpeningBegin();
                    }

                    TryOpeningChildren(panel, false, notify, target);
                });
            });

            var timeToFinishOpening = timeToCloseSameLevel + timeToOpen + timeToOpenParents;

            //Debug.Log(panel.name + " " + timeToFinishOpening);
            panelNodes[panel].Invoke(timeToFinishOpening, () =>
            {
                panelNodes[panel].IsOpen        = true;
                panelNodes[panel].ForceMirrored = false;
                RewindToEndPanelAnimation(panel);

                if (notify)
                {
                    panel.NotifyOpeningEnd();
                }
            });
        }