GameConfig.cs 1006 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. using KairoEngine.Core;
  6. using KairoEngine.Core.ConfigOptions;
  7. namespace KairoEngine.Core.ModuleSystem
  8. {
  9. [CreateAssetMenu(fileName = "GameConfig", menuName = "KairoEngine/GameConfig"), HideMonoScript]
  10. public class GameConfig : ScriptableObject
  11. {
  12. [ListDrawerSettings(DraggableItems = false, HideRemoveButton = true, ShowPaging = false)]
  13. [OnValueChanged("StartModule")]
  14. public List<GameModule> modules = new List<GameModule>();
  15. [InlineProperty, HideLabel] public ConfigOptionsManager configOptions = new ConfigOptionsManager();
  16. private void StartModule()
  17. {
  18. foreach (var module in modules)
  19. {
  20. if(module.isInitialized == false)
  21. {
  22. module.isInitialized = true;
  23. module.gameConfig = this;
  24. }
  25. }
  26. }
  27. }
  28. }