Переглянути джерело

Upgrade GameModule layout

James Peret 2 роки тому
батько
коміт
3d7f6be387

+ 6 - 2
Runtime/ModuleSystem/GameConfig.cs

@@ -13,7 +13,10 @@ namespace KairoEngine.Core.ModuleSystem
     [CreateAssetMenu(fileName = "GameConfig", menuName = "KairoEngine/GameConfig"), HideMonoScript]
     public class GameConfig : ScriptableObject, ISerializationCallbackReceiver
     {
-        [ListDrawerSettings(DraggableItems = false, HideRemoveButton = true, ShowPaging = false)]
+        [OnInspectorInit("GetApplicationName"), ReadOnly] public string applicationName;
+        [OnInspectorInit("GetAppVersion"), ReadOnly] public string appVersion;
+
+        [ListDrawerSettings(DraggableItems = true, HideRemoveButton = false, ShowPaging = false, ListElementLabelName = "@name", HideAddButton = true)]
         [ShowInInspector, NonSerialized, OnValueChanged("StartModule"), LabelText("Game Modules")]
         public List<GameModule> modules = new List<GameModule>();
 
@@ -37,7 +40,8 @@ namespace KairoEngine.Core.ModuleSystem
             }
         }
 
-        
+        private string GetApplicationName() => applicationName = Application.productName;
+        private string GetAppVersion() => appVersion = Application.version;
 
         [NonSerialized] private IEnumerable possibleModules = new ValueDropdownList<GameModule>();
 

+ 5 - 4
Runtime/ModuleSystem/GameModule.cs

@@ -7,16 +7,17 @@ using Sirenix.OdinInspector;
 
 namespace KairoEngine.Core.ModuleSystem
 {
-    [System.Serializable, HideReferenceObjectPicker]
+    [System.Serializable, HideReferenceObjectPicker, Toggle("enableModule")]
     public class GameModule : IComparable<GameModule>
     {
         [SerializeField, HideInInspector] public virtual string name => "Empty Module Slot";
         [SerializeField, HideInInspector] public string typeName = "GameModule";
         [SerializeField, HideInInspector] public string className;
 
-        [InlineButton("Reset", "Reset")]
-        [InlineButton("Remove", "Remove")]
-        [FoldoutGroup("@name")] public bool enableModule = true;
+        // [InlineButton("Reset", "Reset")]
+        // [InlineButton("Remove", "Remove")]
+        // [FoldoutGroup("@name")]
+        public bool enableModule = true;
 
         [HideInInspector] public bool isInitialized = false;
         [HideInInspector, NonSerialized] public GameConfig gameConfig;

+ 1 - 1
Runtime/ObjectPoolModule.cs

@@ -13,7 +13,7 @@ namespace KairoEngine.Core.ObjectPooling
     {
         public override string name => "Object Pool Module";
 
-        [FoldoutGroup("@name")] public List<ObjectPool> pools = new List<ObjectPool>();
+        public List<ObjectPool> pools = new List<ObjectPool>();
         [SerializeField, HideInInspector] private int poolCount;
 
         public ObjectPoolModule(GameConfig config) : base(config)