net.dreditor.presents 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.
- package/.attestation.p7m +0 -0
- package/DREditor.Presents.asmdef +15 -15
- package/DREditor.Presents.asmdef.meta +7 -7
- package/Editor/CreatePresentsWizard.cs +159 -159
- package/Editor/CreatePresentsWizard.cs.meta +11 -11
- package/Editor/DREditor.Presents.Editor.asmdef +17 -17
- package/Editor/DREditor.Presents.Editor.asmdef.meta +7 -7
- package/Editor/DescriptionsByIDOption.cs +105 -105
- package/Editor/DescriptionsByIDOption.cs.meta +1 -1
- package/Editor/PresentDatabaseEditor.cs +183 -183
- package/Editor/PresentDatabaseEditor.cs.meta +11 -11
- package/Editor/PresentEditor.cs +152 -152
- package/Editor/PresentEditor.cs.meta +11 -11
- package/Editor/PresentGoogleSheetsImportOption.cs +54 -54
- package/Editor/PresentGoogleSheetsImportOption.cs.meta +1 -1
- package/Editor/PresentImportOptionBase.cs +131 -131
- package/Editor/PresentImportOptionBase.cs.meta +1 -1
- package/Editor/PresentReactionLevelOption.cs +80 -80
- package/Editor/PresentReactionLevelOption.cs.meta +1 -1
- package/Editor/PresentUtility.cs +41 -41
- package/Editor/PresentUtility.cs.meta +11 -11
- package/Editor/ReactionByIDCharactersOption.cs +135 -135
- package/Editor/ReactionByIDCharactersOption.cs.meta +1 -1
- package/Editor/ReactionByIDOption.cs +53 -53
- package/Editor/ReactionByIDOption.cs.meta +1 -1
- package/Editor/ReactionImportOption.cs +73 -73
- package/Editor/ReactionImportOption.cs.meta +1 -1
- package/Editor/ReactionImporter.cs +58 -58
- package/Editor/ReactionImporter.cs.meta +11 -11
- package/Editor/RenamePresentsByIDOption.cs +95 -95
- package/Editor/RenamePresentsByIDOption.cs.meta +1 -1
- package/Editor/StudentReactionCollectionEditor.cs +103 -103
- package/Editor/StudentReactionCollectionEditor.cs.meta +1 -1
- package/Editor/StudentReactionEditor.cs +82 -82
- package/Editor/StudentReactionEditor.cs.meta +1 -1
- package/Editor.meta +8 -8
- package/IAmountablePresent.cs +28 -28
- package/IAmountablePresent.cs.meta +1 -1
- package/INewPresentObtained.cs +21 -21
- package/INewPresentObtained.cs.meta +1 -1
- package/IPresentData.cs +9 -9
- package/IPresentData.cs.meta +1 -1
- package/IPresentManager.cs +37 -37
- package/IPresentManager.cs.meta +1 -1
- package/IReactionEntry.cs +20 -20
- package/IReactionEntry.cs.meta +1 -1
- package/Present.cs +23 -23
- package/Present.cs.meta +11 -11
- package/PresentData.cs +49 -49
- package/PresentData.cs.meta +11 -11
- package/PresentDatabase.cs +27 -27
- package/PresentDatabase.cs.meta +11 -11
- package/PresentManager.cs +70 -70
- package/PresentManager.cs.meta +11 -11
- package/PresentManagerBase.cs +34 -34
- package/PresentManagerBase.cs.meta +1 -1
- package/PresentReactionLevel.cs +12 -12
- package/PresentReactionLevel.cs.meta +11 -11
- package/PresentSaveBase.cs +25 -25
- package/PresentSaveBase.cs.meta +1 -1
- package/ReactionLevelDatabase.cs +34 -34
- package/ReactionLevelDatabase.cs.meta +11 -11
- package/{Samples → Samples~}/Present_Manager.prefab +54 -54
- package/{Samples → Samples~}/Present_Manager.prefab.meta +7 -7
- package/StudentReaction.cs +27 -27
- package/StudentReaction.cs.meta +1 -1
- package/StudentReactionCollection.cs +44 -44
- package/StudentReactionCollection.cs.meta +1 -1
- package/package.json +39 -34
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
#if UNITY_EDITOR
|
|
3
|
-
using DREditor.Editor.Utility;
|
|
4
|
-
using System;
|
|
5
|
-
using System.Collections.Generic;
|
|
6
|
-
using System.Text.RegularExpressions;
|
|
7
|
-
using UnityEditor;
|
|
8
|
-
using UnityEngine;
|
|
9
|
-
|
|
10
|
-
namespace DREditor.Presents.Editor
|
|
11
|
-
{
|
|
12
|
-
/// <summary>
|
|
13
|
-
///
|
|
14
|
-
/// </summary>
|
|
15
|
-
[Serializable]
|
|
16
|
-
public abstract class PresentImportOptionBase
|
|
17
|
-
{
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] protected PresentDatabase presentDatabase;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[TextArea(10, 50)]
|
|
28
|
-
[Tooltip("")]
|
|
29
|
-
[SerializeField] protected string textArea;
|
|
30
|
-
|
|
31
|
-
/// <summary>
|
|
32
|
-
///
|
|
33
|
-
/// </summary>
|
|
34
|
-
[ReadOnly]
|
|
35
|
-
[Tooltip("")]
|
|
36
|
-
[SerializeField] protected string anyNumberRegex = "\\D+";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
protected readonly string tab = "\t";
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
protected Action Close;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/// <summary>
|
|
52
|
-
///
|
|
53
|
-
/// </summary>
|
|
54
|
-
public abstract void Invoke();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/// <summary>
|
|
58
|
-
///
|
|
59
|
-
/// </summary>
|
|
60
|
-
/// <param name="Close"></param>
|
|
61
|
-
public virtual void Initialize(Action Close)
|
|
62
|
-
{
|
|
63
|
-
this.Close = Close;
|
|
64
|
-
|
|
65
|
-
InitializeDatabases();
|
|
66
|
-
|
|
67
|
-
CloseIfInitializationFailed();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/// <summary>
|
|
71
|
-
///
|
|
72
|
-
/// </summary>
|
|
73
|
-
protected virtual void InitializeDatabases() => presentDatabase = DatabaseUtility.LoadDatabase<PresentDatabase>();
|
|
74
|
-
|
|
75
|
-
/// <summary>
|
|
76
|
-
///
|
|
77
|
-
/// </summary>
|
|
78
|
-
protected virtual void CloseIfInitializationFailed()
|
|
79
|
-
{
|
|
80
|
-
if (InitializationFailed())
|
|
81
|
-
Close();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/// <summary>
|
|
85
|
-
///
|
|
86
|
-
/// </summary>
|
|
87
|
-
/// <returns></returns>
|
|
88
|
-
protected virtual bool InitializationFailed()
|
|
89
|
-
{
|
|
90
|
-
bool result = !presentDatabase;
|
|
91
|
-
|
|
92
|
-
if (result)
|
|
93
|
-
EditorUtility.DisplayDialog("Missing Databases", "Please make sure you have a Present Database to " +
|
|
94
|
-
"use this functionality!", "OK");
|
|
95
|
-
|
|
96
|
-
return result;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/// <summary>
|
|
101
|
-
///
|
|
102
|
-
/// </summary>
|
|
103
|
-
/// <returns></returns>
|
|
104
|
-
protected virtual List<int> GetListOfIDs() => CollectIDs(Regex.Split(textArea, anyNumberRegex));
|
|
105
|
-
|
|
106
|
-
/// <summary>
|
|
107
|
-
///
|
|
108
|
-
/// </summary>
|
|
109
|
-
/// <param name="matches"></param>
|
|
110
|
-
/// <returns></returns>
|
|
111
|
-
protected virtual List<int> CollectIDs(string[] matches)
|
|
112
|
-
{
|
|
113
|
-
List<int> ids = new();
|
|
114
|
-
|
|
115
|
-
foreach (string matchedString in matches)
|
|
116
|
-
{
|
|
117
|
-
if (matchedString == string.Empty)
|
|
118
|
-
continue;
|
|
119
|
-
|
|
120
|
-
int matchedInt = Int32.Parse(matchedString.Replace(tab, ""));
|
|
121
|
-
|
|
122
|
-
if (ids.Contains(matchedInt))
|
|
123
|
-
continue;
|
|
124
|
-
else
|
|
125
|
-
ids.Add(matchedInt);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return ids;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Editor.Utility;
|
|
4
|
+
using System;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using System.Text.RegularExpressions;
|
|
7
|
+
using UnityEditor;
|
|
8
|
+
using UnityEngine;
|
|
9
|
+
|
|
10
|
+
namespace DREditor.Presents.Editor
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
///
|
|
14
|
+
/// </summary>
|
|
15
|
+
[Serializable]
|
|
16
|
+
public abstract class PresentImportOptionBase
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected PresentDatabase presentDatabase;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[TextArea(10, 50)]
|
|
28
|
+
[Tooltip("")]
|
|
29
|
+
[SerializeField] protected string textArea;
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[ReadOnly]
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected string anyNumberRegex = "\\D+";
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
protected readonly string tab = "\t";
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
protected Action Close;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
///
|
|
53
|
+
/// </summary>
|
|
54
|
+
public abstract void Invoke();
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
/// <param name="Close"></param>
|
|
61
|
+
public virtual void Initialize(Action Close)
|
|
62
|
+
{
|
|
63
|
+
this.Close = Close;
|
|
64
|
+
|
|
65
|
+
InitializeDatabases();
|
|
66
|
+
|
|
67
|
+
CloseIfInitializationFailed();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
protected virtual void InitializeDatabases() => presentDatabase = DatabaseUtility.LoadDatabase<PresentDatabase>();
|
|
74
|
+
|
|
75
|
+
/// <summary>
|
|
76
|
+
///
|
|
77
|
+
/// </summary>
|
|
78
|
+
protected virtual void CloseIfInitializationFailed()
|
|
79
|
+
{
|
|
80
|
+
if (InitializationFailed())
|
|
81
|
+
Close();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
///
|
|
86
|
+
/// </summary>
|
|
87
|
+
/// <returns></returns>
|
|
88
|
+
protected virtual bool InitializationFailed()
|
|
89
|
+
{
|
|
90
|
+
bool result = !presentDatabase;
|
|
91
|
+
|
|
92
|
+
if (result)
|
|
93
|
+
EditorUtility.DisplayDialog("Missing Databases", "Please make sure you have a Present Database to " +
|
|
94
|
+
"use this functionality!", "OK");
|
|
95
|
+
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
///
|
|
102
|
+
/// </summary>
|
|
103
|
+
/// <returns></returns>
|
|
104
|
+
protected virtual List<int> GetListOfIDs() => CollectIDs(Regex.Split(textArea, anyNumberRegex));
|
|
105
|
+
|
|
106
|
+
/// <summary>
|
|
107
|
+
///
|
|
108
|
+
/// </summary>
|
|
109
|
+
/// <param name="matches"></param>
|
|
110
|
+
/// <returns></returns>
|
|
111
|
+
protected virtual List<int> CollectIDs(string[] matches)
|
|
112
|
+
{
|
|
113
|
+
List<int> ids = new();
|
|
114
|
+
|
|
115
|
+
foreach (string matchedString in matches)
|
|
116
|
+
{
|
|
117
|
+
if (matchedString == string.Empty)
|
|
118
|
+
continue;
|
|
119
|
+
|
|
120
|
+
int matchedInt = Int32.Parse(matchedString.Replace(tab, ""));
|
|
121
|
+
|
|
122
|
+
if (ids.Contains(matchedInt))
|
|
123
|
+
continue;
|
|
124
|
+
else
|
|
125
|
+
ids.Add(matchedInt);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return ids;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
132
|
#endif
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: 181680e0c922de443843ec188f54f789
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
#if UNITY_EDITOR
|
|
3
|
-
using DREditor.Characters;
|
|
4
|
-
using System;
|
|
5
|
-
using System.Text.RegularExpressions;
|
|
6
|
-
using UnityEditor;
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
|
|
9
|
-
namespace DREditor.Presents.Editor
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
[Serializable]
|
|
15
|
-
public class PresentReactionLevelOption : ReactionImportOption
|
|
16
|
-
{
|
|
17
|
-
/// <summary>
|
|
18
|
-
///
|
|
19
|
-
/// </summary>
|
|
20
|
-
[Header("")]
|
|
21
|
-
[Divider]
|
|
22
|
-
[Tooltip("")]
|
|
23
|
-
[SerializeField] protected Character character;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/// <inheritdoc/>
|
|
27
|
-
public override void Invoke()
|
|
28
|
-
{
|
|
29
|
-
if (InvalidCharacterSelected())
|
|
30
|
-
return;
|
|
31
|
-
|
|
32
|
-
AssetDatabase.StartAssetEditing();
|
|
33
|
-
|
|
34
|
-
SetPresentsReactionLevel();
|
|
35
|
-
|
|
36
|
-
AssetDatabase.StopAssetEditing();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
/// <returns></returns>
|
|
43
|
-
protected virtual bool InvalidCharacterSelected()
|
|
44
|
-
{
|
|
45
|
-
bool result = character == null || string.IsNullOrEmpty(character.FirstName);
|
|
46
|
-
|
|
47
|
-
if (result)
|
|
48
|
-
{
|
|
49
|
-
EditorUtility.DisplayDialog("No Character Selected", "Please make sure you select a character to " +
|
|
50
|
-
"use this functionality!", "OK");
|
|
51
|
-
|
|
52
|
-
Close();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/// <summary>
|
|
59
|
-
///
|
|
60
|
-
/// </summary>
|
|
61
|
-
protected virtual void SetPresentsReactionLevel()
|
|
62
|
-
{
|
|
63
|
-
int count = 0;
|
|
64
|
-
|
|
65
|
-
foreach (Present present in presentDatabase.presents)
|
|
66
|
-
{
|
|
67
|
-
var matches = Regex.Match(textArea, present.DisplayName);
|
|
68
|
-
|
|
69
|
-
if (matches.Length > 0)
|
|
70
|
-
{
|
|
71
|
-
count++;
|
|
72
|
-
|
|
73
|
-
ApplyReactions(present, character.FirstName);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
UnityEngine.Debug.Log("REPORT: Found Presents: " + count);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Characters;
|
|
4
|
+
using System;
|
|
5
|
+
using System.Text.RegularExpressions;
|
|
6
|
+
using UnityEditor;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Presents.Editor
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[Serializable]
|
|
15
|
+
public class PresentReactionLevelOption : ReactionImportOption
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Header("")]
|
|
21
|
+
[Divider]
|
|
22
|
+
[Tooltip("")]
|
|
23
|
+
[SerializeField] protected Character character;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/// <inheritdoc/>
|
|
27
|
+
public override void Invoke()
|
|
28
|
+
{
|
|
29
|
+
if (InvalidCharacterSelected())
|
|
30
|
+
return;
|
|
31
|
+
|
|
32
|
+
AssetDatabase.StartAssetEditing();
|
|
33
|
+
|
|
34
|
+
SetPresentsReactionLevel();
|
|
35
|
+
|
|
36
|
+
AssetDatabase.StopAssetEditing();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
/// <returns></returns>
|
|
43
|
+
protected virtual bool InvalidCharacterSelected()
|
|
44
|
+
{
|
|
45
|
+
bool result = character == null || string.IsNullOrEmpty(character.FirstName);
|
|
46
|
+
|
|
47
|
+
if (result)
|
|
48
|
+
{
|
|
49
|
+
EditorUtility.DisplayDialog("No Character Selected", "Please make sure you select a character to " +
|
|
50
|
+
"use this functionality!", "OK");
|
|
51
|
+
|
|
52
|
+
Close();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
///
|
|
60
|
+
/// </summary>
|
|
61
|
+
protected virtual void SetPresentsReactionLevel()
|
|
62
|
+
{
|
|
63
|
+
int count = 0;
|
|
64
|
+
|
|
65
|
+
foreach (Present present in presentDatabase.presents)
|
|
66
|
+
{
|
|
67
|
+
var matches = Regex.Match(textArea, present.DisplayName);
|
|
68
|
+
|
|
69
|
+
if (matches.Length > 0)
|
|
70
|
+
{
|
|
71
|
+
count++;
|
|
72
|
+
|
|
73
|
+
ApplyReactions(present, character.FirstName);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
UnityEngine.Debug.Log("REPORT: Found Presents: " + count);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
81
|
#endif
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: 09c941dfdccb62048b79f4370323b982
|
package/Editor/PresentUtility.cs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
#if UNITY_EDITOR
|
|
3
|
-
using DREditor.Editor.Utility;
|
|
4
|
-
using DREditor.Services;
|
|
5
|
-
using UnityEditor;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.Presents.Editor
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
public static class PresentUtility
|
|
14
|
-
{
|
|
15
|
-
/// <summary>
|
|
16
|
-
///
|
|
17
|
-
/// </summary>
|
|
18
|
-
[MenuItem("DREditor/FTE/Give All Presents")]
|
|
19
|
-
public static void DebugGiveAllPresents()
|
|
20
|
-
{
|
|
21
|
-
if (!Application.isPlaying)
|
|
22
|
-
{
|
|
23
|
-
UnityEngine.Debug.LogWarning("ANALYSIS: You must be in play mode to use this command.");
|
|
24
|
-
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (!ServiceLocator.HasService(out IPresentManager presentManager))
|
|
29
|
-
{
|
|
30
|
-
UnityEngine.Debug.LogWarning($"ALERT: There was no service with the type {nameof(IPresentManager)}, aborting command.");
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
PresentDatabase presentDatabase = BuilderUtility.FindAssetByType<PresentDatabase>();
|
|
36
|
-
|
|
37
|
-
foreach (Present present in presentDatabase.presents)
|
|
38
|
-
presentManager?.AddPresent(present.ID);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
#if UNITY_EDITOR
|
|
3
|
+
using DREditor.Editor.Utility;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
using UnityEditor;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Presents.Editor
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
public static class PresentUtility
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
[MenuItem("DREditor/FTE/Give All Presents")]
|
|
19
|
+
public static void DebugGiveAllPresents()
|
|
20
|
+
{
|
|
21
|
+
if (!Application.isPlaying)
|
|
22
|
+
{
|
|
23
|
+
UnityEngine.Debug.LogWarning("ANALYSIS: You must be in play mode to use this command.");
|
|
24
|
+
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!ServiceLocator.HasService(out IPresentManager presentManager))
|
|
29
|
+
{
|
|
30
|
+
UnityEngine.Debug.LogWarning($"ALERT: There was no service with the type {nameof(IPresentManager)}, aborting command.");
|
|
31
|
+
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
PresentDatabase presentDatabase = BuilderUtility.FindAssetByType<PresentDatabase>();
|
|
36
|
+
|
|
37
|
+
foreach (Present present in presentDatabase.presents)
|
|
38
|
+
presentManager?.AddPresent(present.ID);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
42
|
#endif
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: ce5fbd679e20bd644bb32770b5f7a894
|
|
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: ce5fbd679e20bd644bb32770b5f7a894
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|