public void OpenNewWindow(AppScreen window) { if (windows.Count > 0) { windows[windows.Count - 1].OnScreenClose(); } window = Instantiate(window.gameObject, mainCanvas.transform).GetComponent <AppScreen>(); windows.Add(window); window.transform.SetAsLastSibling(); window.OnScreenOpen(); ManageBackButton(); }
public void OpenNewLesson(LessonData data) { windows[windows.Count - 1].OnScreenClose(); currentLesson = Instantiate(GetLessonPrefabByType(data.type), Vector3.zero, Quaternion.identity).GetComponent <AppScreen>(); currentLesson.OnScreenOpen(data); }