net.dreditor.actors 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/Actor.cs +74 -74
- package/Actor.cs.meta +11 -11
- package/ActorBodyDebugger.cs +117 -117
- package/ActorBodyDebugger.cs.meta +13 -13
- package/ActorManager.cs +149 -149
- package/ActorManager.cs.meta +11 -11
- package/ActorOrganizer.cs +93 -93
- package/ActorOrganizer.cs.meta +11 -11
- package/BasicExpressionChanger.cs +157 -157
- package/BasicExpressionChanger.cs.meta +11 -11
- package/BasicLayerHandler.cs +108 -108
- package/BasicLayerHandler.cs.meta +11 -11
- package/DREditor.Actors.asmdef +20 -20
- package/DREditor.Actors.asmdef.meta +7 -7
- package/Editor/AssignmentStyleGUIEditor.cs +171 -171
- package/Editor/AssignmentStyleGUIEditor.cs.meta +1 -1
- package/Editor/AutoCreateCharacterWizard.cs +475 -475
- package/Editor/AutoCreateCharacterWizard.cs.meta +11 -11
- package/Editor/AutoCreateTrialCharacterWizard.cs +426 -426
- package/Editor/AutoCreateTrialCharacterWizard.cs.meta +1 -1
- package/Editor/CharacterUtility.cs +119 -119
- package/Editor/CharacterUtility.cs.meta +11 -11
- package/Editor/CircleDrawer.cs +206 -206
- package/Editor/CircleDrawer.cs.meta +1 -1
- package/Editor/CircleUtility.cs +54 -54
- package/Editor/CircleUtility.cs.meta +1 -1
- package/Editor/DREditor.Actors.Editor.asmdef +21 -21
- package/Editor/DREditor.Actors.Editor.asmdef.meta +7 -7
- package/Editor/GenerateCharacterIntroDialogues.cs +234 -234
- package/Editor/GenerateCharacterIntroDialogues.cs.meta +11 -11
- package/Editor/IItemImporter.cs +19 -19
- package/Editor/IItemImporter.cs.meta +1 -1
- package/Editor/ItemImporter.cs +170 -170
- package/Editor/ItemImporter.cs.meta +1 -1
- package/Editor/ItemUtility.cs +85 -85
- package/Editor/ItemUtility.cs.meta +11 -11
- package/Editor/ItemWizard.cs +41 -41
- package/Editor/ItemWizard.cs.meta +11 -11
- package/Editor.meta +8 -8
- package/Events/ActorCheckFocusEvent.cs +49 -49
- package/Events/ActorCheckFocusEvent.cs.meta +11 -11
- package/Events/ActorFadeEvent.cs +19 -19
- package/Events/ActorFadeEvent.cs.meta +11 -11
- package/Events/ActorFadeHandler.cs +53 -53
- package/Events/ActorFadeHandler.cs.meta +11 -11
- package/Events/ActorFaintEvent.cs +282 -282
- package/Events/ActorFaintEvent.cs.meta +11 -11
- package/Events/ActorFaintEventRenderQ.cs +65 -65
- package/Events/ActorFaintEventRenderQ.cs.meta +11 -11
- package/Events/ActorLeaveHandler.cs +238 -238
- package/Events/ActorLeaveHandler.cs.meta +11 -11
- package/Events/ActorSpriteFader.cs +190 -190
- package/Events/ActorSpriteFader.cs.meta +11 -11
- package/Events/ActorSpriteFaderRenderQ.cs +49 -49
- package/Events/ActorSpriteFaderRenderQ.cs.meta +11 -11
- package/Events/BSTrialActorFlash.cs +259 -259
- package/Events/BSTrialActorFlash.cs.meta +11 -11
- package/Events/ChangeLastFocusEvent.cs +62 -62
- package/Events/ChangeLastFocusEvent.cs.meta +11 -11
- package/Events/MoveCharacterEvent.cs +141 -141
- package/Events/MoveCharacterEvent.cs.meta +11 -11
- package/Events.meta +8 -8
- package/ExpressionChanger.cs +25 -25
- package/ExpressionChanger.cs.meta +11 -11
- package/FocusHandler.cs +96 -96
- package/FocusHandler.cs.meta +11 -11
- package/Implementation/ActorFocusHandler.cs +195 -195
- package/Implementation/ActorFocusHandler.cs.meta +11 -11
- package/Implementation/ActorFocusLoadEnd.cs +108 -108
- package/Implementation/ActorFocusLoadEnd.cs.meta +11 -11
- package/Implementation/ActorFocusPrepare.cs +102 -102
- package/Implementation/ActorFocusPrepare.cs.meta +11 -11
- package/Implementation/ActorFocusResolve.cs +67 -67
- package/Implementation/ActorFocusResolve.cs.meta +11 -11
- package/Implementation/ActorSpriteChanger.cs +129 -129
- package/Implementation/ActorSpriteChanger.cs.meta +11 -11
- package/Implementation/ActorTrialSpriteChanger.cs +46 -46
- package/Implementation/ActorTrialSpriteChanger.cs.meta +11 -11
- package/Implementation/ChangeLastSpriteEvent.cs +92 -92
- package/Implementation/ChangeLastSpriteEvent.cs.meta +11 -11
- package/Implementation/WorldSpriteChanger.cs +207 -207
- package/Implementation/WorldSpriteChanger.cs.meta +11 -11
- package/Implementation.meta +8 -8
- package/LayerHandler.cs +30 -30
- package/LayerHandler.cs.meta +11 -11
- package/{Samples → Samples~}/Actor.prefab +581 -581
- package/{Samples → Samples~}/Actor.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Body_Debugger.prefab +68 -68
- package/{Samples → Samples~}/Actor_Body_Debugger.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Check_Focus_Event.prefab +47 -47
- package/{Samples → Samples~}/Actor_Check_Focus_Event.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Event_Handlers.prefab +668 -668
- package/{Samples → Samples~}/Actor_Event_Handlers.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Fade_Handler.prefab +137 -137
- package/{Samples → Samples~}/Actor_Fade_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Fade_Handler_Render_Q.prefab +137 -137
- package/{Samples → Samples~}/Actor_Fade_Handler_Render_Q.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Faint_Event.prefab +71 -71
- package/{Samples → Samples~}/Actor_Faint_Event.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Faint_Event_Render_Q.prefab +73 -73
- package/{Samples → Samples~}/Actor_Faint_Event_Render_Q.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Focus_Handler.prefab +168 -168
- package/{Samples → Samples~}/Actor_Focus_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Focus_Handler_Shell.prefab +56 -56
- package/{Samples → Samples~}/Actor_Focus_Handler_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Focus_Load_End.prefab +66 -66
- package/{Samples → Samples~}/Actor_Focus_Load_End.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Focus_Prepare.prefab +49 -49
- package/{Samples → Samples~}/Actor_Focus_Prepare.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Focus_Resolve.prefab +48 -48
- package/{Samples → Samples~}/Actor_Focus_Resolve.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Leave_Handler.prefab +141 -141
- package/{Samples → Samples~}/Actor_Leave_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Leave_Handler_Render_Q.prefab +141 -141
- package/{Samples → Samples~}/Actor_Leave_Handler_Render_Q.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Organizer.prefab +49 -49
- package/{Samples → Samples~}/Actor_Organizer.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Sprite_Changer.prefab +163 -163
- package/{Samples → Samples~}/Actor_Sprite_Changer.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Sprite_Changer_Shell.prefab +51 -51
- package/{Samples → Samples~}/Actor_Sprite_Changer_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Sprite_Fader.prefab +52 -52
- package/{Samples → Samples~}/Actor_Sprite_Fader.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Sprite_Fader_Render_Q.prefab +54 -54
- package/{Samples → Samples~}/Actor_Sprite_Fader_Render_Q.prefab.meta +7 -7
- package/{Samples → Samples~}/Actor_Trial_Sprite_Changer.prefab +47 -47
- package/{Samples → Samples~}/Actor_Trial_Sprite_Changer.prefab.meta +7 -7
- package/{Samples → Samples~}/Change_Last_Focus_Event.prefab +66 -66
- package/{Samples → Samples~}/Change_Last_Focus_Event.prefab.meta +7 -7
- package/{Samples → Samples~}/Change_Last_Sprite_Event.prefab +49 -49
- package/{Samples → Samples~}/Change_Last_Sprite_Event.prefab.meta +7 -7
- package/{Samples → Samples~}/Change_Last_World_Sprite_Event.prefab +186 -186
- package/{Samples → Samples~}/Change_Last_World_Sprite_Event.prefab.meta +7 -7
- package/{Samples → Samples~}/Focus_Handler.prefab +49 -49
- package/{Samples → Samples~}/Focus_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Move_Character_Event.prefab +51 -51
- package/{Samples → Samples~}/Move_Character_Event.prefab.meta +7 -7
- package/{Samples → Samples~}/World_Sprite_Changer.prefab +51 -51
- package/{Samples → Samples~}/World_Sprite_Changer.prefab.meta +7 -7
- package/package.json +43 -38
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
package/Editor/ItemImporter.cs
CHANGED
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System;
|
|
3
|
-
using System.IO;
|
|
4
|
-
using System.Linq;
|
|
5
|
-
using UnityEditor;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.Actors.Editor
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
[Serializable]
|
|
14
|
-
public class ItemImporter : IItemImporter
|
|
15
|
-
{
|
|
16
|
-
/// <summary>
|
|
17
|
-
///
|
|
18
|
-
/// </summary>
|
|
19
|
-
[Header("")]
|
|
20
|
-
[Divider]
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] protected bool useMeshSelection = false;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Tooltip("")]
|
|
28
|
-
[SerializeField] protected bool addCamsToBodies = false;
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
[Tooltip("")]
|
|
34
|
-
[TextArea(5, 100)]
|
|
35
|
-
public string textArea = "";
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/// <summary>
|
|
39
|
-
///
|
|
40
|
-
/// </summary>
|
|
41
|
-
protected GameObject item;
|
|
42
|
-
|
|
43
|
-
/// <summary>
|
|
44
|
-
///
|
|
45
|
-
/// </summary>
|
|
46
|
-
protected string displayName = string.Empty;
|
|
47
|
-
|
|
48
|
-
/// <summary>
|
|
49
|
-
///
|
|
50
|
-
/// </summary>
|
|
51
|
-
protected int itemIndex;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
public virtual bool ImporterValid()
|
|
55
|
-
{
|
|
56
|
-
bool result = ItemsCanBeImported();
|
|
57
|
-
|
|
58
|
-
if (!result)
|
|
59
|
-
OnImportInvalid();
|
|
60
|
-
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/// <summary>
|
|
65
|
-
///
|
|
66
|
-
/// </summary>
|
|
67
|
-
/// <returns></returns>
|
|
68
|
-
protected virtual bool ItemsCanBeImported() => !string.IsNullOrEmpty(textArea);
|
|
69
|
-
|
|
70
|
-
/// <summary>
|
|
71
|
-
///
|
|
72
|
-
/// </summary>
|
|
73
|
-
protected virtual void OnImportInvalid() => UnityEngine.Debug.LogWarning("ALERT: Item Field was empty! Aborting process.");
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
public virtual void Import()
|
|
77
|
-
{
|
|
78
|
-
ResetValues();
|
|
79
|
-
|
|
80
|
-
ImportItemsFromTextArea();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/// <summary>
|
|
84
|
-
///
|
|
85
|
-
/// </summary>
|
|
86
|
-
protected virtual void ResetValues() => itemIndex = 0;
|
|
87
|
-
|
|
88
|
-
/// <summary>
|
|
89
|
-
///
|
|
90
|
-
/// </summary>
|
|
91
|
-
protected virtual void ImportItemsFromTextArea()
|
|
92
|
-
{
|
|
93
|
-
using StringReader reader = new(textArea);
|
|
94
|
-
|
|
95
|
-
while (reader.ReadLine() is string line && line != null)
|
|
96
|
-
BuildItemFrom(line);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/// <summary>
|
|
100
|
-
///
|
|
101
|
-
/// </summary>
|
|
102
|
-
protected virtual void BuildItemFrom(string line)
|
|
103
|
-
{
|
|
104
|
-
InitializeReadValues(line);
|
|
105
|
-
|
|
106
|
-
BuildItemGameObject();
|
|
107
|
-
|
|
108
|
-
GenerateItemAttributes();
|
|
109
|
-
|
|
110
|
-
SetItemName();
|
|
111
|
-
|
|
112
|
-
OnBuiltItemComplete();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/// <summary>
|
|
116
|
-
///
|
|
117
|
-
/// </summary>
|
|
118
|
-
/// <param name="line"></param>
|
|
119
|
-
protected virtual void InitializeReadValues(string line)
|
|
120
|
-
{
|
|
121
|
-
displayName = line;
|
|
122
|
-
|
|
123
|
-
itemIndex = useMeshSelection ? itemIndex : -1;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/// <summary>
|
|
127
|
-
///
|
|
128
|
-
/// </summary>
|
|
129
|
-
/// <returns></returns>
|
|
130
|
-
protected virtual void BuildItemGameObject() =>
|
|
131
|
-
item = itemIndex != -1 ? BuildQuad() : new GameObject();
|
|
132
|
-
|
|
133
|
-
/// <summary>
|
|
134
|
-
///
|
|
135
|
-
/// </summary>
|
|
136
|
-
/// <returns></returns>
|
|
137
|
-
protected virtual GameObject BuildQuad()
|
|
138
|
-
{
|
|
139
|
-
GameObject gameObject;
|
|
140
|
-
|
|
141
|
-
gameObject = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
|
142
|
-
|
|
143
|
-
var materials = Selection.GetFiltered(typeof(Material), SelectionMode.Assets).Cast<Material>().ToList();
|
|
144
|
-
|
|
145
|
-
if (materials.Count > itemIndex)
|
|
146
|
-
gameObject.GetComponent<MeshRenderer>().material = materials[itemIndex];
|
|
147
|
-
|
|
148
|
-
return gameObject;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/// <summary>
|
|
152
|
-
///
|
|
153
|
-
/// </summary>
|
|
154
|
-
protected virtual void GenerateItemAttributes()
|
|
155
|
-
{
|
|
156
|
-
item.name = displayName;
|
|
157
|
-
|
|
158
|
-
ItemUtility.ApplyItemProperties(item, addCamsToBodies);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/// <summary>
|
|
162
|
-
///
|
|
163
|
-
/// </summary>
|
|
164
|
-
protected virtual void SetItemName() => item.name = displayName.Replace(" ", "_");
|
|
165
|
-
|
|
166
|
-
/// <summary>
|
|
167
|
-
///
|
|
168
|
-
/// </summary>
|
|
169
|
-
protected virtual void OnBuiltItemComplete() => itemIndex++;
|
|
170
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using System.Linq;
|
|
5
|
+
using UnityEditor;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Actors.Editor
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[Serializable]
|
|
14
|
+
public class ItemImporter : IItemImporter
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Header("")]
|
|
20
|
+
[Divider]
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected bool useMeshSelection = false;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected bool addCamsToBodies = false;
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
[Tooltip("")]
|
|
34
|
+
[TextArea(5, 100)]
|
|
35
|
+
public string textArea = "";
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
protected GameObject item;
|
|
42
|
+
|
|
43
|
+
/// <summary>
|
|
44
|
+
///
|
|
45
|
+
/// </summary>
|
|
46
|
+
protected string displayName = string.Empty;
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
///
|
|
50
|
+
/// </summary>
|
|
51
|
+
protected int itemIndex;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
public virtual bool ImporterValid()
|
|
55
|
+
{
|
|
56
|
+
bool result = ItemsCanBeImported();
|
|
57
|
+
|
|
58
|
+
if (!result)
|
|
59
|
+
OnImportInvalid();
|
|
60
|
+
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// <summary>
|
|
65
|
+
///
|
|
66
|
+
/// </summary>
|
|
67
|
+
/// <returns></returns>
|
|
68
|
+
protected virtual bool ItemsCanBeImported() => !string.IsNullOrEmpty(textArea);
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
protected virtual void OnImportInvalid() => UnityEngine.Debug.LogWarning("ALERT: Item Field was empty! Aborting process.");
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
public virtual void Import()
|
|
77
|
+
{
|
|
78
|
+
ResetValues();
|
|
79
|
+
|
|
80
|
+
ImportItemsFromTextArea();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// <summary>
|
|
84
|
+
///
|
|
85
|
+
/// </summary>
|
|
86
|
+
protected virtual void ResetValues() => itemIndex = 0;
|
|
87
|
+
|
|
88
|
+
/// <summary>
|
|
89
|
+
///
|
|
90
|
+
/// </summary>
|
|
91
|
+
protected virtual void ImportItemsFromTextArea()
|
|
92
|
+
{
|
|
93
|
+
using StringReader reader = new(textArea);
|
|
94
|
+
|
|
95
|
+
while (reader.ReadLine() is string line && line != null)
|
|
96
|
+
BuildItemFrom(line);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/// <summary>
|
|
100
|
+
///
|
|
101
|
+
/// </summary>
|
|
102
|
+
protected virtual void BuildItemFrom(string line)
|
|
103
|
+
{
|
|
104
|
+
InitializeReadValues(line);
|
|
105
|
+
|
|
106
|
+
BuildItemGameObject();
|
|
107
|
+
|
|
108
|
+
GenerateItemAttributes();
|
|
109
|
+
|
|
110
|
+
SetItemName();
|
|
111
|
+
|
|
112
|
+
OnBuiltItemComplete();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/// <summary>
|
|
116
|
+
///
|
|
117
|
+
/// </summary>
|
|
118
|
+
/// <param name="line"></param>
|
|
119
|
+
protected virtual void InitializeReadValues(string line)
|
|
120
|
+
{
|
|
121
|
+
displayName = line;
|
|
122
|
+
|
|
123
|
+
itemIndex = useMeshSelection ? itemIndex : -1;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/// <summary>
|
|
127
|
+
///
|
|
128
|
+
/// </summary>
|
|
129
|
+
/// <returns></returns>
|
|
130
|
+
protected virtual void BuildItemGameObject() =>
|
|
131
|
+
item = itemIndex != -1 ? BuildQuad() : new GameObject();
|
|
132
|
+
|
|
133
|
+
/// <summary>
|
|
134
|
+
///
|
|
135
|
+
/// </summary>
|
|
136
|
+
/// <returns></returns>
|
|
137
|
+
protected virtual GameObject BuildQuad()
|
|
138
|
+
{
|
|
139
|
+
GameObject gameObject;
|
|
140
|
+
|
|
141
|
+
gameObject = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
|
142
|
+
|
|
143
|
+
var materials = Selection.GetFiltered(typeof(Material), SelectionMode.Assets).Cast<Material>().ToList();
|
|
144
|
+
|
|
145
|
+
if (materials.Count > itemIndex)
|
|
146
|
+
gameObject.GetComponent<MeshRenderer>().material = materials[itemIndex];
|
|
147
|
+
|
|
148
|
+
return gameObject;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/// <summary>
|
|
152
|
+
///
|
|
153
|
+
/// </summary>
|
|
154
|
+
protected virtual void GenerateItemAttributes()
|
|
155
|
+
{
|
|
156
|
+
item.name = displayName;
|
|
157
|
+
|
|
158
|
+
ItemUtility.ApplyItemProperties(item, addCamsToBodies);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/// <summary>
|
|
162
|
+
///
|
|
163
|
+
/// </summary>
|
|
164
|
+
protected virtual void SetItemName() => item.name = displayName.Replace(" ", "_");
|
|
165
|
+
|
|
166
|
+
/// <summary>
|
|
167
|
+
///
|
|
168
|
+
/// </summary>
|
|
169
|
+
protected virtual void OnBuiltItemComplete() => itemIndex++;
|
|
170
|
+
}
|
|
171
171
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: c422b7627132d794591ef3f02bf3fab9
|
package/Editor/ItemUtility.cs
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Talkables;
|
|
3
|
-
using System.Linq;
|
|
4
|
-
using UnityEditor;
|
|
5
|
-
using UnityEngine;
|
|
6
|
-
using UnityEngine.Rendering.Universal;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.Actors.Editor
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
public static class ItemUtility
|
|
14
|
-
{
|
|
15
|
-
/// <summary>
|
|
16
|
-
///
|
|
17
|
-
/// </summary>
|
|
18
|
-
[MenuItem("DREditor/Items/Apply Item Properties")]
|
|
19
|
-
public static void ApplyItem()
|
|
20
|
-
{
|
|
21
|
-
foreach (GameObject gameObject in Selection.gameObjects)
|
|
22
|
-
ApplyItemProperties(gameObject);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/// <summary>
|
|
26
|
-
///
|
|
27
|
-
/// </summary>
|
|
28
|
-
/// <param name="gameObject"></param>
|
|
29
|
-
/// <param name="addCamsToBodies"></param>
|
|
30
|
-
public static void ApplyItemProperties(GameObject gameObject, bool addCamsToBodies = false)
|
|
31
|
-
{
|
|
32
|
-
ItemActor item = gameObject.AddComponent<ItemActor>();
|
|
33
|
-
|
|
34
|
-
while (UnityEditorInternal.ComponentUtility.MoveComponentUp(item)) { }
|
|
35
|
-
|
|
36
|
-
item.EditorInstantiation();
|
|
37
|
-
|
|
38
|
-
if (addCamsToBodies && gameObject.FindFirstChildContaining("Body", out GameObject child))
|
|
39
|
-
child.AddComponent<UnityEngine.Camera>();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/// <summary>
|
|
43
|
-
///
|
|
44
|
-
/// </summary>
|
|
45
|
-
/// <param name="gameObject"></param>
|
|
46
|
-
/// <param name="subString"></param>
|
|
47
|
-
/// <param name="result"></param>
|
|
48
|
-
/// <returns></returns>
|
|
49
|
-
private static bool FindFirstChildContaining(this GameObject gameObject, string subString, out GameObject result)
|
|
50
|
-
{
|
|
51
|
-
result = null;
|
|
52
|
-
|
|
53
|
-
foreach (Transform child in gameObject.transform)
|
|
54
|
-
if (child.name.Contains(subString))
|
|
55
|
-
result = child.gameObject;
|
|
56
|
-
|
|
57
|
-
return result != null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/// <summary>
|
|
62
|
-
///
|
|
63
|
-
/// </summary>
|
|
64
|
-
[MenuItem("DREditor/Items/Remove Cameras")]
|
|
65
|
-
public static void RemoveCameras()
|
|
66
|
-
{
|
|
67
|
-
var gameObjects = MonoBehaviour
|
|
68
|
-
.FindObjectsByType<GameObject>()
|
|
69
|
-
.Where(gameObject =>
|
|
70
|
-
!gameObject.name.Contains("Camera") &&
|
|
71
|
-
gameObject.GetComponent<UnityEngine.Camera>() != null &&
|
|
72
|
-
gameObject.activeSelf)
|
|
73
|
-
.ToList();
|
|
74
|
-
|
|
75
|
-
foreach (GameObject gameObject in gameObjects)
|
|
76
|
-
{
|
|
77
|
-
MonoBehaviour.DestroyImmediate(gameObject.GetComponent<UniversalAdditionalCameraData>());
|
|
78
|
-
|
|
79
|
-
MonoBehaviour.DestroyImmediate(gameObject.GetComponent<UnityEngine.Camera>());
|
|
80
|
-
|
|
81
|
-
EditorUtility.SetDirty(gameObject);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Talkables;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
using UnityEngine.Rendering.Universal;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Actors.Editor
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
public static class ItemUtility
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
[MenuItem("DREditor/Items/Apply Item Properties")]
|
|
19
|
+
public static void ApplyItem()
|
|
20
|
+
{
|
|
21
|
+
foreach (GameObject gameObject in Selection.gameObjects)
|
|
22
|
+
ApplyItemProperties(gameObject);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
/// <param name="gameObject"></param>
|
|
29
|
+
/// <param name="addCamsToBodies"></param>
|
|
30
|
+
public static void ApplyItemProperties(GameObject gameObject, bool addCamsToBodies = false)
|
|
31
|
+
{
|
|
32
|
+
ItemActor item = gameObject.AddComponent<ItemActor>();
|
|
33
|
+
|
|
34
|
+
while (UnityEditorInternal.ComponentUtility.MoveComponentUp(item)) { }
|
|
35
|
+
|
|
36
|
+
item.EditorInstantiation();
|
|
37
|
+
|
|
38
|
+
if (addCamsToBodies && gameObject.FindFirstChildContaining("Body", out GameObject child))
|
|
39
|
+
child.AddComponent<UnityEngine.Camera>();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
///
|
|
44
|
+
/// </summary>
|
|
45
|
+
/// <param name="gameObject"></param>
|
|
46
|
+
/// <param name="subString"></param>
|
|
47
|
+
/// <param name="result"></param>
|
|
48
|
+
/// <returns></returns>
|
|
49
|
+
private static bool FindFirstChildContaining(this GameObject gameObject, string subString, out GameObject result)
|
|
50
|
+
{
|
|
51
|
+
result = null;
|
|
52
|
+
|
|
53
|
+
foreach (Transform child in gameObject.transform)
|
|
54
|
+
if (child.name.Contains(subString))
|
|
55
|
+
result = child.gameObject;
|
|
56
|
+
|
|
57
|
+
return result != null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/// <summary>
|
|
62
|
+
///
|
|
63
|
+
/// </summary>
|
|
64
|
+
[MenuItem("DREditor/Items/Remove Cameras")]
|
|
65
|
+
public static void RemoveCameras()
|
|
66
|
+
{
|
|
67
|
+
var gameObjects = MonoBehaviour
|
|
68
|
+
.FindObjectsByType<GameObject>()
|
|
69
|
+
.Where(gameObject =>
|
|
70
|
+
!gameObject.name.Contains("Camera") &&
|
|
71
|
+
gameObject.GetComponent<UnityEngine.Camera>() != null &&
|
|
72
|
+
gameObject.activeSelf)
|
|
73
|
+
.ToList();
|
|
74
|
+
|
|
75
|
+
foreach (GameObject gameObject in gameObjects)
|
|
76
|
+
{
|
|
77
|
+
MonoBehaviour.DestroyImmediate(gameObject.GetComponent<UniversalAdditionalCameraData>());
|
|
78
|
+
|
|
79
|
+
MonoBehaviour.DestroyImmediate(gameObject.GetComponent<UnityEngine.Camera>());
|
|
80
|
+
|
|
81
|
+
EditorUtility.SetDirty(gameObject);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 50440b30e53289e48a7583e60c47a710
|
|
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: 50440b30e53289e48a7583e60c47a710
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Editor/ItemWizard.cs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using UnityEditor;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
|
|
5
|
-
namespace DREditor.Actors.Editor
|
|
6
|
-
{
|
|
7
|
-
/// <summary>
|
|
8
|
-
///
|
|
9
|
-
/// </summary>
|
|
10
|
-
public class ItemWizard : ScriptableWizard
|
|
11
|
-
{
|
|
12
|
-
/// <summary>
|
|
13
|
-
///
|
|
14
|
-
/// </summary>
|
|
15
|
-
[Header("")]
|
|
16
|
-
[Divider]
|
|
17
|
-
[Tooltip("")]
|
|
18
|
-
[SelectType]
|
|
19
|
-
[SerializeReference] protected IItemImporter importer = new ItemImporter();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[MenuItem("DREditor/Import/Items")]
|
|
23
|
-
public static void CreateWizard() => DisplayWizard<ItemWizard>("Item Wizard", "Import");
|
|
24
|
-
|
|
25
|
-
protected virtual void OnWizardCreate()
|
|
26
|
-
{
|
|
27
|
-
if (ImportValid())
|
|
28
|
-
Import();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/// <summary>
|
|
32
|
-
///
|
|
33
|
-
/// </summary>
|
|
34
|
-
/// <returns></returns>
|
|
35
|
-
protected virtual bool ImportValid() => importer != null && importer.ImporterValid();
|
|
36
|
-
|
|
37
|
-
/// <summary>
|
|
38
|
-
///
|
|
39
|
-
/// </summary>
|
|
40
|
-
protected virtual void Import() => importer?.Import();
|
|
41
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.Actors.Editor
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
public class ItemWizard : ScriptableWizard
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
///
|
|
14
|
+
/// </summary>
|
|
15
|
+
[Header("")]
|
|
16
|
+
[Divider]
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SelectType]
|
|
19
|
+
[SerializeReference] protected IItemImporter importer = new ItemImporter();
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
[MenuItem("DREditor/Import/Items")]
|
|
23
|
+
public static void CreateWizard() => DisplayWizard<ItemWizard>("Item Wizard", "Import");
|
|
24
|
+
|
|
25
|
+
protected virtual void OnWizardCreate()
|
|
26
|
+
{
|
|
27
|
+
if (ImportValid())
|
|
28
|
+
Import();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
/// <returns></returns>
|
|
35
|
+
protected virtual bool ImportValid() => importer != null && importer.ImporterValid();
|
|
36
|
+
|
|
37
|
+
/// <summary>
|
|
38
|
+
///
|
|
39
|
+
/// </summary>
|
|
40
|
+
protected virtual void Import() => importer?.Import();
|
|
41
|
+
}
|
|
42
42
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 66ff142f0e1215e418400087e8fbe8b3
|
|
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: 66ff142f0e1215e418400087e8fbe8b3
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Editor.meta
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 2f410f74b3f8dad44a6dba7c619d69f3
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
DefaultImporter:
|
|
5
|
-
externalObjects: {}
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 2f410f74b3f8dad44a6dba7c619d69f3
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
DefaultImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|