Browse Source

Added more options to GameModule

James Peret 2 years ago
parent
commit
2ef853de3c
1 changed files with 19 additions and 2 deletions
  1. 19 2
      Runtime/AchievementsModule.cs

+ 19 - 2
Runtime/AchievementsModule.cs

@@ -12,7 +12,14 @@ namespace KairoEngine.Achievements
     public class AchievementsModule : GameModuleBase
     {
         public override string name => "Achievements Module";
+        [FoldoutGroup("@name")] public bool CheckOnStart = true;
+        [FoldoutGroup("@name")] public bool checkOnInterval = true;
+        [FoldoutGroup("@name"), ShowIf("@checkOnInterval"), SuffixLabel("ms")] public int checkInterval = 3000;
+        [FoldoutGroup("@name"), SuffixLabel("ms")] public int startDelay = 3000;
+        [FoldoutGroup("@name")] public bool debug = false;
         [FoldoutGroup("@name"), NonSerialized, ShowInInspector, InlineEditor(InlineEditorObjectFieldModes.Boxed)] public AchievementsLibrary library;
+        
+        
 
         public AchievementsModule(GameConfig config) : base(config)
         {
@@ -32,12 +39,22 @@ namespace KairoEngine.Achievements
             obj.transform.parent = parent;
             obj.name = "Achievements";
             var comp = obj.AddComponent<AchievementsController>();
-            comp.library = library;
+            comp.library = this.library;
+            comp.CheckOnStart = this.CheckOnStart;
+            comp.checkOnInterval = this.checkOnInterval;
+            comp.checkInterval = this.checkInterval;
+            comp.startDelay = this.startDelay;
+            comp.debug = this.debug;
         }
 
         public override void Reset()
         {
-            
+            this.library = null;
+            this.CheckOnStart = true;
+            this.checkOnInterval = true;
+            this.checkInterval = 3000;
+            this.startDelay = 3000;
+            this.debug = false;
         }
 
         public override void Destroy() { }