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(); } }
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); } } }
private void OnOneDialogOpened(PopBase dialog) { }
public PopBase GetPop(PopType type) { PopBase pop = basePops[(int)type]; return((PopBase)Instantiate(pop, transform.position, transform.rotation)); }