예제 #1
0
 private void Init()
 {
     self = this;
     asset_resource_manager     = new ResourceManager <Asset>();
     personage_resource_manager = new ResourceManager <Personage>();
     window_manager             = new WindowManager();
     user_inventory             = new UserInventory();
     personage = new PersonageModel(personage_resource_manager.GetResource("Human"));
     FillUserInventory();
     InitPersonage();
 }
예제 #2
0
        private void loadResources()
        {
            ResourceManager.GetResource("quad", "mesh").Preload();

            ResourceManager.GetResource("space", "material").Preload();
            ResourceManager.GetResource("pewpew", "material").Preload();
            ResourceManager.GetResource("pewpew_alien", "material").Preload();
            ResourceManager.GetResource("player", "material").Preload();
            ResourceManager.GetResource("player_death", "material").Preload();
            ResourceManager.GetResource("alien_hammerhead", "material").Preload();
            ResourceManager.GetResource("alien_pincher", "material").Preload();
            ResourceManager.GetResource("alien_ray", "material").Preload();
            ResourceManager.GetResource("mystery_ship", "material").Preload();
        }
예제 #3
0
        public void OpenWindow <T>(WindowInitializer <T> init = null) where T : BaseWindow
        {
            var type = typeof(T);

            if (!window_pool.TryDequeue(type.Name, out BaseWindow window))
            {
                window = BaseWindow.Create <T>(window_resource_manager.GetResource(type.Name));
            }

            if (window.Unique)
            {
                CloseWindows(window.Name);
            }

            init?.Invoke((T)window);
            active_windows.Add(window);
            window.Open();
        }