Beispiel #1
0
        public T GetView <T>() where T : View
        {
            var view = viewDatabase.GetViewPrefab <T>();

            if (view != null)
            {
                return(Object.Instantiate((T)view));
            }
            return(default);
Beispiel #2
0
        public T ShowView <T>() where T : View
        {
            var prefab = viewDatabase.GetViewPrefab <T>();

            if (prefab != null)
            {
                var instance = Object.Instantiate((T)prefab);
                instance.SetCameraDepth(viewStack.Count);
                instance.OnClosed += ClosedView;
                viewStack.Add(instance);
                return(instance);
            }
            return(default);