net.dreditor.minigames.mc 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1,22 +1,22 @@
1
- {
2
- "name": "DREditor.Minigames.MC",
3
- "rootNamespace": "",
4
- "references": [
5
- "Unity.InputSystem",
6
- "Unity.TextMeshPro",
7
- "DREditor",
8
- "DREditor.Editor",
9
- "DREditor.UIHandling",
10
- "DREditor.Audio",
11
- "DREditor.Minigames"
12
- ],
13
- "includePlatforms": [],
14
- "excludePlatforms": [],
15
- "allowUnsafeCode": false,
16
- "overrideReferences": false,
17
- "precompiledReferences": [],
18
- "autoReferenced": true,
19
- "defineConstraints": [],
20
- "versionDefines": [],
21
- "noEngineReferences": false
1
+ {
2
+ "name": "DREditor.Minigames.MC",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "Unity.InputSystem",
6
+ "Unity.TextMeshPro",
7
+ "DREditor",
8
+ "DREditor.Editor",
9
+ "DREditor.UIHandling",
10
+ "DREditor.Audio",
11
+ "DREditor.Minigames"
12
+ ],
13
+ "includePlatforms": [],
14
+ "excludePlatforms": [],
15
+ "allowUnsafeCode": false,
16
+ "overrideReferences": false,
17
+ "precompiledReferences": [],
18
+ "autoReferenced": true,
19
+ "defineConstraints": [],
20
+ "versionDefines": [],
21
+ "noEngineReferences": false
22
22
  }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: c7af95dca39690644b4f4b5c592cdc6c
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: c7af95dca39690644b4f4b5c592cdc6c
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,78 +1,78 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using System.Collections.Generic;
3
- using System.Linq;
4
- using UnityEditor;
5
- using UnityEngine;
6
-
7
- namespace DREditor.Minigames.MC
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [System.Serializable]
13
- [CreateAssetMenu(menuName = "DREditor/Minigames/Multiple Choice", fileName = "MC Builder")]
14
- public class MultipleChoiceBuilder : MinigameBuilderBase
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- public List<MultipleChoiceOption> choices = new() { new(), new(), new(), new() };
20
-
21
- /// <summary>
22
- ///
23
- /// </summary>
24
- public string question = "";
25
-
26
- /// <summary>
27
- ///
28
- /// </summary>
29
- public int damageOnWrong = 1;
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- public float timerMinutes;
35
-
36
- /// <summary>
37
- ///
38
- /// </summary>
39
- [Range(0, 59)]
40
- public float timerSeconds;
41
-
42
-
43
- /// <summary>
44
- ///
45
- /// </summary>
46
- /// <param name="question"></param>
47
- public virtual void SetQuestion(string question) => this.question = question;
48
-
49
- /// <summary>
50
- ///
51
- /// </summary>
52
- /// <param name="damageOnWrong"></param>
53
- public virtual void SetDamageOnWrong(int damageOnWrong) => this.damageOnWrong = damageOnWrong;
54
-
55
-
56
- /// <summary>
57
- ///
58
- /// </summary>
59
- /// <param name="text"></param>
60
- /// <returns></returns>
61
- public virtual MultipleChoiceOption GetOptionWithText(string text)
62
- {
63
- for (int i = 0; i < choices.Count; i++)
64
- if (choices[i].text == text)
65
- return choices[i];
66
-
67
- UnityEngine.Debug.LogWarning("ALERT: Selected choice text did not contain an existing answer.");
68
-
69
- return null;
70
- }
71
-
72
- /// <summary>
73
- ///
74
- /// </summary>
75
- /// <returns></returns>
76
- public virtual List<string> GetChoiceTexts() => choices.Select(choice => choice.text).ToList();
77
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System.Collections.Generic;
3
+ using System.Linq;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.Minigames.MC
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [System.Serializable]
13
+ [CreateAssetMenu(menuName = "DREditor/Minigames/Multiple Choice", fileName = "MC Builder")]
14
+ public class MultipleChoiceBuilder : MinigameBuilderBase
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ public List<MultipleChoiceOption> choices = new() { new(), new(), new(), new() };
20
+
21
+ /// <summary>
22
+ ///
23
+ /// </summary>
24
+ public string question = "";
25
+
26
+ /// <summary>
27
+ ///
28
+ /// </summary>
29
+ public int damageOnWrong = 1;
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ public float timerMinutes;
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ [Range(0, 59)]
40
+ public float timerSeconds;
41
+
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ /// <param name="question"></param>
47
+ public virtual void SetQuestion(string question) => this.question = question;
48
+
49
+ /// <summary>
50
+ ///
51
+ /// </summary>
52
+ /// <param name="damageOnWrong"></param>
53
+ public virtual void SetDamageOnWrong(int damageOnWrong) => this.damageOnWrong = damageOnWrong;
54
+
55
+
56
+ /// <summary>
57
+ ///
58
+ /// </summary>
59
+ /// <param name="text"></param>
60
+ /// <returns></returns>
61
+ public virtual MultipleChoiceOption GetOptionWithText(string text)
62
+ {
63
+ for (int i = 0; i < choices.Count; i++)
64
+ if (choices[i].text == text)
65
+ return choices[i];
66
+
67
+ UnityEngine.Debug.LogWarning("ALERT: Selected choice text did not contain an existing answer.");
68
+
69
+ return null;
70
+ }
71
+
72
+ /// <summary>
73
+ ///
74
+ /// </summary>
75
+ /// <returns></returns>
76
+ public virtual List<string> GetChoiceTexts() => choices.Select(choice => choice.text).ToList();
77
+ }
78
78
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: de460dd51c9cc8d4ea96bfe4ece1bb55
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: de460dd51c9cc8d4ea96bfe4ece1bb55
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,76 +1,76 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if UNITY_EDITOR
3
- using DREditor.Editor.Utility;
4
- using UnityEditor;
5
- using UnityEngine;
6
-
7
- namespace DREditor.Minigames.MC
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [CustomEditor(typeof(MultipleChoiceBuilder))]
13
- public class MultipleChoiceBuilderEditor : TimedMinigameEditor<MultipleChoiceBuilder>
14
- {
15
- /// <inheritdoc/>
16
- public override void OnInspectorGUI()
17
- {
18
- serializedObject.Update();
19
-
20
- CreateForm();
21
-
22
- EditorUtility.SetDirty(builder);
23
-
24
- serializedObject.ApplyModifiedProperties();
25
- }
26
-
27
- /// <summary>
28
- ///
29
- /// </summary>
30
- protected virtual void CreateForm()
31
- {
32
- DisplayBuilderInformation();
33
-
34
- DisplayChoices();
35
- }
36
-
37
- /// <summary>
38
- ///
39
- /// </summary>
40
- protected virtual void DisplayBuilderInformation()
41
- {
42
- builder.SetQuestion(HandyFields.StringArea("Question: ", builder.question));
43
-
44
- builder.SetDamageOnWrong(HandyFields.IntField("Damage on Wrong: ", builder.damageOnWrong, 25, 7));
45
-
46
- builder.SetDifficultyTimes(TimerDifficultyEditor.DisplaySettings(builder.times));
47
-
48
- using (new GUILayout.HorizontalScope())
49
- GUILayout.Label("", GUILayout.Width(120));
50
- }
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- protected virtual void DisplayChoices()
56
- {
57
- for (int i = 0; i < builder.choices.Count; i++)
58
- {
59
- MultipleChoiceOptionEditor.Display(builder.choices[i]);
60
-
61
- if (GUILayout.Button("Remove Choice", GUILayout.Width(120)))
62
- builder.choices.RemoveAt(i);
63
-
64
- using (new GUILayout.HorizontalScope())
65
- GUILayout.Label("", GUILayout.Width(120));
66
- }
67
-
68
- using (new GUILayout.HorizontalScope())
69
- GUILayout.Label("", GUILayout.Width(120));
70
-
71
- if (GUILayout.Button("Add Choice", GUILayout.Width(120)))
72
- builder.choices.Add(new());
73
- }
74
- }
75
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if UNITY_EDITOR
3
+ using DREditor.Editor.Utility;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.Minigames.MC
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [CustomEditor(typeof(MultipleChoiceBuilder))]
13
+ public class MultipleChoiceBuilderEditor : TimedMinigameEditor<MultipleChoiceBuilder>
14
+ {
15
+ /// <inheritdoc/>
16
+ public override void OnInspectorGUI()
17
+ {
18
+ serializedObject.Update();
19
+
20
+ CreateForm();
21
+
22
+ EditorUtility.SetDirty(builder);
23
+
24
+ serializedObject.ApplyModifiedProperties();
25
+ }
26
+
27
+ /// <summary>
28
+ ///
29
+ /// </summary>
30
+ protected virtual void CreateForm()
31
+ {
32
+ DisplayBuilderInformation();
33
+
34
+ DisplayChoices();
35
+ }
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ protected virtual void DisplayBuilderInformation()
41
+ {
42
+ builder.SetQuestion(HandyFields.StringArea("Question: ", builder.question));
43
+
44
+ builder.SetDamageOnWrong(HandyFields.IntField("Damage on Wrong: ", builder.damageOnWrong, 25, 7));
45
+
46
+ builder.SetDifficultyTimes(TimerDifficultyEditor.DisplaySettings(builder.times));
47
+
48
+ using (new GUILayout.HorizontalScope())
49
+ GUILayout.Label("", GUILayout.Width(120));
50
+ }
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ protected virtual void DisplayChoices()
56
+ {
57
+ for (int i = 0; i < builder.choices.Count; i++)
58
+ {
59
+ MultipleChoiceOptionEditor.Display(builder.choices[i]);
60
+
61
+ if (GUILayout.Button("Remove Choice", GUILayout.Width(120)))
62
+ builder.choices.RemoveAt(i);
63
+
64
+ using (new GUILayout.HorizontalScope())
65
+ GUILayout.Label("", GUILayout.Width(120));
66
+ }
67
+
68
+ using (new GUILayout.HorizontalScope())
69
+ GUILayout.Label("", GUILayout.Width(120));
70
+
71
+ if (GUILayout.Button("Add Choice", GUILayout.Width(120)))
72
+ builder.choices.Add(new());
73
+ }
74
+ }
75
+ }
76
76
  #endif
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 7f003336b71e7704992ed8ea81ffdcdf
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 7f003336b71e7704992ed8ea81ffdcdf
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: