Beispiel #1
0
 public void OpenScreen(UiScreenType newScreenType)
 {
     ScreenType = newScreenType;
     HudScreen.SetActive(newScreenType == UiScreenType.Hud);
     OptionsScreen.SetActive(newScreenType == UiScreenType.Options);
     OnScreenChanged?.Invoke(ScreenType);
 }
Beispiel #2
0
 public static void SetScreenVisibility(UiScreenType screenType, Booleans isVisible)
 {
     var entityManager = World.Active.GetOrCreateManager<EntityManager>();
     var requestEntity = entityManager.CreateEntity();
     entityManager.AddComponentData(requestEntity, new SetScreenVisibilityRequest
     {
         isVisible = isVisible,
         screenType = screenType
     });
 }
Beispiel #3
0
 public void SetScreenVisibility(UiScreenType screenType, bool isVisible)
 {
     for (int i = 0; i < screenGroup.Length; i++)
     {
         if (screenGroup.uiScreen[i].type == screenType)
         {
             var entity = screenGroup.entity[i];
             if (isVisible)
             {
                 if (!EntityManager.HasComponent <Visible>(entity))
                 {
                     PostUpdateCommands.AddComponent(entity, new Visible());
                 }
             }
             else
             {
                 if (EntityManager.HasComponent <Visible>(entity))
                 {
                     PostUpdateCommands.RemoveComponent <Visible>(entity);
                 }
             }
         }
     }
 }
Beispiel #4
0
 void OnScreenTypeChanged(UiScreenType newScreen) => Game.IsPaused = newScreen != UiScreenType.Hud;