private IEnumerator ShowDialog(float delay = 3f) { //dialog.gameObject.SetActive(true); DialoguePanel dialoguePanel = PanelManager.panelManager.GetPanelByType(BasePanel.PanelType.Dialogue) as DialoguePanel; dialoguePanel.OpenAndShow(dialogue); yield return(new WaitForSeconds(effects[0].delay)); if (effects != null) { ActivateAllEffects(); } else { Debug.Log("Effects was null"); } //if(effects.Count > 0) { // Debug.Log("more then 0 effects"); //} //else { // Debug.Log(" 0 effects"); //} yield return(new WaitForSeconds(2.5f)); dialoguePanel.HideDialoge(); }