Ejemplo n.º 1
0
 public void ShowPop(PopBase pop, PopShow option = PopShow.REPLACE_CURRENT)
 {
     if (current != null)
     {
         if (option == PopShow.DONT_SHOW_IF_OTHERS_SHOWING)
         {
             Destroy(pop.gameObject);
         }
         else if (option == PopShow.REPLACE_CURRENT)
         {
             current.Close();
         }
         else if (option == PopShow.STACK)
         {
             current.Hide();
         }
     }
     current = pop;
     if (option != PopShow.SHOW_PREVIOUS)
     {
         current.onDialogClosed += OnOneDialogClosed;
         current.onDialogOpened += OnOneDialogOpened;
         pops.Push(current);
     }
     current.ShowPop();
     if (onPopOpened != null)
     {
         onPopOpened();
     }
 }
Ejemplo n.º 2
0
        private void OnOneDialogClosed(PopBase dialog)
        {
            if (current == dialog)
            {
                current = null;
                pops.Pop();
                if (onPopClosed != null && pops.Count == 0)
                {
                    onPopClosed();
                }

                if (pops.Count > 0)
                {
                    ShowPop(pops.Peek(), PopShow.SHOW_PREVIOUS);
                }
            }
        }
Ejemplo n.º 3
0
 private void OnOneDialogOpened(PopBase dialog)
 {
 }
Ejemplo n.º 4
0
        public PopBase GetPop(PopType type)
        {
            PopBase pop = basePops[(int)type];

            return((PopBase)Instantiate(pop, transform.position, transform.rotation));
        }