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.
Files changed (143) hide show
  1. package/.attestation.p7m +0 -0
  2. package/Actor.cs +74 -74
  3. package/Actor.cs.meta +11 -11
  4. package/ActorBodyDebugger.cs +117 -117
  5. package/ActorBodyDebugger.cs.meta +13 -13
  6. package/ActorManager.cs +149 -149
  7. package/ActorManager.cs.meta +11 -11
  8. package/ActorOrganizer.cs +93 -93
  9. package/ActorOrganizer.cs.meta +11 -11
  10. package/BasicExpressionChanger.cs +157 -157
  11. package/BasicExpressionChanger.cs.meta +11 -11
  12. package/BasicLayerHandler.cs +108 -108
  13. package/BasicLayerHandler.cs.meta +11 -11
  14. package/DREditor.Actors.asmdef +20 -20
  15. package/DREditor.Actors.asmdef.meta +7 -7
  16. package/Editor/AssignmentStyleGUIEditor.cs +171 -171
  17. package/Editor/AssignmentStyleGUIEditor.cs.meta +1 -1
  18. package/Editor/AutoCreateCharacterWizard.cs +475 -475
  19. package/Editor/AutoCreateCharacterWizard.cs.meta +11 -11
  20. package/Editor/AutoCreateTrialCharacterWizard.cs +426 -426
  21. package/Editor/AutoCreateTrialCharacterWizard.cs.meta +1 -1
  22. package/Editor/CharacterUtility.cs +119 -119
  23. package/Editor/CharacterUtility.cs.meta +11 -11
  24. package/Editor/CircleDrawer.cs +206 -206
  25. package/Editor/CircleDrawer.cs.meta +1 -1
  26. package/Editor/CircleUtility.cs +54 -54
  27. package/Editor/CircleUtility.cs.meta +1 -1
  28. package/Editor/DREditor.Actors.Editor.asmdef +21 -21
  29. package/Editor/DREditor.Actors.Editor.asmdef.meta +7 -7
  30. package/Editor/GenerateCharacterIntroDialogues.cs +234 -234
  31. package/Editor/GenerateCharacterIntroDialogues.cs.meta +11 -11
  32. package/Editor/IItemImporter.cs +19 -19
  33. package/Editor/IItemImporter.cs.meta +1 -1
  34. package/Editor/ItemImporter.cs +170 -170
  35. package/Editor/ItemImporter.cs.meta +1 -1
  36. package/Editor/ItemUtility.cs +85 -85
  37. package/Editor/ItemUtility.cs.meta +11 -11
  38. package/Editor/ItemWizard.cs +41 -41
  39. package/Editor/ItemWizard.cs.meta +11 -11
  40. package/Editor.meta +8 -8
  41. package/Events/ActorCheckFocusEvent.cs +49 -49
  42. package/Events/ActorCheckFocusEvent.cs.meta +11 -11
  43. package/Events/ActorFadeEvent.cs +19 -19
  44. package/Events/ActorFadeEvent.cs.meta +11 -11
  45. package/Events/ActorFadeHandler.cs +53 -53
  46. package/Events/ActorFadeHandler.cs.meta +11 -11
  47. package/Events/ActorFaintEvent.cs +282 -282
  48. package/Events/ActorFaintEvent.cs.meta +11 -11
  49. package/Events/ActorFaintEventRenderQ.cs +65 -65
  50. package/Events/ActorFaintEventRenderQ.cs.meta +11 -11
  51. package/Events/ActorLeaveHandler.cs +238 -238
  52. package/Events/ActorLeaveHandler.cs.meta +11 -11
  53. package/Events/ActorSpriteFader.cs +190 -190
  54. package/Events/ActorSpriteFader.cs.meta +11 -11
  55. package/Events/ActorSpriteFaderRenderQ.cs +49 -49
  56. package/Events/ActorSpriteFaderRenderQ.cs.meta +11 -11
  57. package/Events/BSTrialActorFlash.cs +259 -259
  58. package/Events/BSTrialActorFlash.cs.meta +11 -11
  59. package/Events/ChangeLastFocusEvent.cs +62 -62
  60. package/Events/ChangeLastFocusEvent.cs.meta +11 -11
  61. package/Events/MoveCharacterEvent.cs +141 -141
  62. package/Events/MoveCharacterEvent.cs.meta +11 -11
  63. package/Events.meta +8 -8
  64. package/ExpressionChanger.cs +25 -25
  65. package/ExpressionChanger.cs.meta +11 -11
  66. package/FocusHandler.cs +96 -96
  67. package/FocusHandler.cs.meta +11 -11
  68. package/Implementation/ActorFocusHandler.cs +195 -195
  69. package/Implementation/ActorFocusHandler.cs.meta +11 -11
  70. package/Implementation/ActorFocusLoadEnd.cs +108 -108
  71. package/Implementation/ActorFocusLoadEnd.cs.meta +11 -11
  72. package/Implementation/ActorFocusPrepare.cs +102 -102
  73. package/Implementation/ActorFocusPrepare.cs.meta +11 -11
  74. package/Implementation/ActorFocusResolve.cs +67 -67
  75. package/Implementation/ActorFocusResolve.cs.meta +11 -11
  76. package/Implementation/ActorSpriteChanger.cs +129 -129
  77. package/Implementation/ActorSpriteChanger.cs.meta +11 -11
  78. package/Implementation/ActorTrialSpriteChanger.cs +46 -46
  79. package/Implementation/ActorTrialSpriteChanger.cs.meta +11 -11
  80. package/Implementation/ChangeLastSpriteEvent.cs +92 -92
  81. package/Implementation/ChangeLastSpriteEvent.cs.meta +11 -11
  82. package/Implementation/WorldSpriteChanger.cs +207 -207
  83. package/Implementation/WorldSpriteChanger.cs.meta +11 -11
  84. package/Implementation.meta +8 -8
  85. package/LayerHandler.cs +30 -30
  86. package/LayerHandler.cs.meta +11 -11
  87. package/{Samples → Samples~}/Actor.prefab +581 -581
  88. package/{Samples → Samples~}/Actor.prefab.meta +7 -7
  89. package/{Samples → Samples~}/Actor_Body_Debugger.prefab +68 -68
  90. package/{Samples → Samples~}/Actor_Body_Debugger.prefab.meta +7 -7
  91. package/{Samples → Samples~}/Actor_Check_Focus_Event.prefab +47 -47
  92. package/{Samples → Samples~}/Actor_Check_Focus_Event.prefab.meta +7 -7
  93. package/{Samples → Samples~}/Actor_Event_Handlers.prefab +668 -668
  94. package/{Samples → Samples~}/Actor_Event_Handlers.prefab.meta +7 -7
  95. package/{Samples → Samples~}/Actor_Fade_Handler.prefab +137 -137
  96. package/{Samples → Samples~}/Actor_Fade_Handler.prefab.meta +7 -7
  97. package/{Samples → Samples~}/Actor_Fade_Handler_Render_Q.prefab +137 -137
  98. package/{Samples → Samples~}/Actor_Fade_Handler_Render_Q.prefab.meta +7 -7
  99. package/{Samples → Samples~}/Actor_Faint_Event.prefab +71 -71
  100. package/{Samples → Samples~}/Actor_Faint_Event.prefab.meta +7 -7
  101. package/{Samples → Samples~}/Actor_Faint_Event_Render_Q.prefab +73 -73
  102. package/{Samples → Samples~}/Actor_Faint_Event_Render_Q.prefab.meta +7 -7
  103. package/{Samples → Samples~}/Actor_Focus_Handler.prefab +168 -168
  104. package/{Samples → Samples~}/Actor_Focus_Handler.prefab.meta +7 -7
  105. package/{Samples → Samples~}/Actor_Focus_Handler_Shell.prefab +56 -56
  106. package/{Samples → Samples~}/Actor_Focus_Handler_Shell.prefab.meta +7 -7
  107. package/{Samples → Samples~}/Actor_Focus_Load_End.prefab +66 -66
  108. package/{Samples → Samples~}/Actor_Focus_Load_End.prefab.meta +7 -7
  109. package/{Samples → Samples~}/Actor_Focus_Prepare.prefab +49 -49
  110. package/{Samples → Samples~}/Actor_Focus_Prepare.prefab.meta +7 -7
  111. package/{Samples → Samples~}/Actor_Focus_Resolve.prefab +48 -48
  112. package/{Samples → Samples~}/Actor_Focus_Resolve.prefab.meta +7 -7
  113. package/{Samples → Samples~}/Actor_Leave_Handler.prefab +141 -141
  114. package/{Samples → Samples~}/Actor_Leave_Handler.prefab.meta +7 -7
  115. package/{Samples → Samples~}/Actor_Leave_Handler_Render_Q.prefab +141 -141
  116. package/{Samples → Samples~}/Actor_Leave_Handler_Render_Q.prefab.meta +7 -7
  117. package/{Samples → Samples~}/Actor_Organizer.prefab +49 -49
  118. package/{Samples → Samples~}/Actor_Organizer.prefab.meta +7 -7
  119. package/{Samples → Samples~}/Actor_Sprite_Changer.prefab +163 -163
  120. package/{Samples → Samples~}/Actor_Sprite_Changer.prefab.meta +7 -7
  121. package/{Samples → Samples~}/Actor_Sprite_Changer_Shell.prefab +51 -51
  122. package/{Samples → Samples~}/Actor_Sprite_Changer_Shell.prefab.meta +7 -7
  123. package/{Samples → Samples~}/Actor_Sprite_Fader.prefab +52 -52
  124. package/{Samples → Samples~}/Actor_Sprite_Fader.prefab.meta +7 -7
  125. package/{Samples → Samples~}/Actor_Sprite_Fader_Render_Q.prefab +54 -54
  126. package/{Samples → Samples~}/Actor_Sprite_Fader_Render_Q.prefab.meta +7 -7
  127. package/{Samples → Samples~}/Actor_Trial_Sprite_Changer.prefab +47 -47
  128. package/{Samples → Samples~}/Actor_Trial_Sprite_Changer.prefab.meta +7 -7
  129. package/{Samples → Samples~}/Change_Last_Focus_Event.prefab +66 -66
  130. package/{Samples → Samples~}/Change_Last_Focus_Event.prefab.meta +7 -7
  131. package/{Samples → Samples~}/Change_Last_Sprite_Event.prefab +49 -49
  132. package/{Samples → Samples~}/Change_Last_Sprite_Event.prefab.meta +7 -7
  133. package/{Samples → Samples~}/Change_Last_World_Sprite_Event.prefab +186 -186
  134. package/{Samples → Samples~}/Change_Last_World_Sprite_Event.prefab.meta +7 -7
  135. package/{Samples → Samples~}/Focus_Handler.prefab +49 -49
  136. package/{Samples → Samples~}/Focus_Handler.prefab.meta +7 -7
  137. package/{Samples → Samples~}/Move_Character_Event.prefab +51 -51
  138. package/{Samples → Samples~}/Move_Character_Event.prefab.meta +7 -7
  139. package/{Samples → Samples~}/World_Sprite_Changer.prefab +51 -51
  140. package/{Samples → Samples~}/World_Sprite_Changer.prefab.meta +7 -7
  141. package/package.json +43 -38
  142. package/package.json.meta +7 -7
  143. package/Samples.meta +0 -8
package/ActorManager.cs CHANGED
@@ -1,150 +1,150 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using DREditor.Services;
4
- using DREditor.Talkables;
5
- using System.Collections.Generic;
6
- using System.Linq;
7
- using UnityEngine;
8
-
9
- namespace DREditor.Actors
10
- {
11
- /// <summary>
12
- ///
13
- /// </summary>
14
- [ClassHeader(nameof(DialogueObjectManager) + ", " + nameof(IObjectPooler<Talkable>) +
15
- "\n\n")]
16
- public class ActorManager : DialogueObjectManager, IObjectPooler<Talkable>
17
- {
18
- /// <summary>
19
- ///
20
- /// </summary>
21
- [Tooltip("")]
22
- [SerializeField] protected string tutorialCharacterFirstName = "Tutorial";
23
-
24
- /// <summary>
25
- ///
26
- /// </summary>
27
- [Tooltip("")]
28
- [SerializeField] protected bool logActorsNotFound = false;
29
-
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- [Header("")]
35
- [Divider]
36
- [Tooltip("")]
37
- [SerializeField] protected List<Talkable> actors = new();
38
-
39
-
40
- /// <summary>
41
- ///
42
- /// </summary>
43
- protected IDialogueManager dialogueManager = null;
44
-
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- protected virtual void OnEnable()
50
- {
51
- if (gameObject != null)
52
- {
53
- RegisterService<DialogueObjectManager>(this);
54
-
55
- RegisterService<IObjectPooler<Talkable>>(this);
56
- }
57
-
58
- dialogueManager = ServiceLocator.GetService<IDialogueManager>();
59
-
60
- if (dialogueManager != null)
61
- dialogueManager.GetEnder().OnDialogueResolving += SetStartObjectNull;
62
- }
63
-
64
- /// <summary>
65
- ///
66
- /// </summary>
67
- /// <typeparam name="T"></typeparam>
68
- /// <param name="service"></param>
69
- protected virtual void RegisterService<T>(T service) where T : class
70
- {
71
- if (!ServiceLocator.HasService<T>())
72
- ServiceLocator.Register(service);
73
- else
74
- Destroy(gameObject);
75
- }
76
-
77
-
78
- /// <summary>
79
- ///
80
- /// </summary>
81
- protected virtual void OnDisable()
82
- {
83
- if (dialogueManager != null)
84
- dialogueManager.GetEnder().OnDialogueResolving -= SetStartObjectNull;
85
- }
86
-
87
-
88
- /// <inheritdoc/>
89
- public virtual void RegisterObject(Talkable obj)
90
- {
91
- if (obj is Talkable talkable)
92
- {
93
- if (actors.Contains(talkable))
94
- return;
95
-
96
- actors.Add(talkable);
97
-
98
- talkable.SubscribeToStartConversation(Evaluate);
99
- }
100
- else
101
- UnityEngine.Debug.LogWarning("Object Tried To register to a Pooler that doesn't use it's type");
102
- }
103
-
104
- /// <inheritdoc/>
105
- public virtual void UnregisterObject(Talkable obj)
106
- {
107
- actors.Remove(obj);
108
-
109
- obj.UnsubscribeToStartConversation(Evaluate);
110
- }
111
-
112
- /// <summary>
113
- ///
114
- /// </summary>
115
- /// <param name="talkable"></param>
116
- /// <param name="Conversation"></param>
117
- protected virtual void Evaluate(Talkable talkable, Dialogue[] Conversation)
118
- {
119
- startObject = talkable;
120
-
121
- if (ServiceLocator.HasService<IDialogueManager>())
122
- {
123
- if (Conversation[0] != null)
124
- ServiceLocator.GetService<IDialogueManager>().StartDialogue(talkable, Conversation);
125
- else
126
- ServiceLocator.GetService<IDialogueManager>().DebugNoCharacterDialogueCall(talkable);
127
- }
128
- else
129
- UnityEngine.Debug.LogWarning($"ALERT: {ToString()}: ActorManager could not get {nameof(IDialogueManager)}!");
130
- }
131
-
132
-
133
- /// <inheritdoc/>
134
- public virtual Talkable GetObjectByName(string name)
135
- {
136
- var actors = GetRegisteredObjects().OfType<Talkable>()
137
- .Where(talkable => talkable.gameObject.name == name);
138
-
139
- if (actors.Any())
140
- return actors.First();
141
- else if (name != tutorialCharacterFirstName && logActorsNotFound)
142
- UnityEngine.Debug.Log($"REPORT: {ToString()}: Couldn't find actor: {name}.");
143
-
144
- return null;
145
- }
146
-
147
- /// <inheritdoc/>
148
- public virtual List<Talkable> GetRegisteredObjects() => actors;
149
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Services;
4
+ using DREditor.Talkables;
5
+ using System.Collections.Generic;
6
+ using System.Linq;
7
+ using UnityEngine;
8
+
9
+ namespace DREditor.Actors
10
+ {
11
+ /// <summary>
12
+ ///
13
+ /// </summary>
14
+ [ClassHeader(nameof(DialogueObjectManager) + ", " + nameof(IObjectPooler<Talkable>) +
15
+ "\n\n")]
16
+ public class ActorManager : DialogueObjectManager, IObjectPooler<Talkable>
17
+ {
18
+ /// <summary>
19
+ ///
20
+ /// </summary>
21
+ [Tooltip("")]
22
+ [SerializeField] protected string tutorialCharacterFirstName = "Tutorial";
23
+
24
+ /// <summary>
25
+ ///
26
+ /// </summary>
27
+ [Tooltip("")]
28
+ [SerializeField] protected bool logActorsNotFound = false;
29
+
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ [Header("")]
35
+ [Divider]
36
+ [Tooltip("")]
37
+ [SerializeField] protected List<Talkable> actors = new();
38
+
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ protected IDialogueManager dialogueManager = null;
44
+
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ protected virtual void OnEnable()
50
+ {
51
+ if (gameObject != null)
52
+ {
53
+ RegisterService<DialogueObjectManager>(this);
54
+
55
+ RegisterService<IObjectPooler<Talkable>>(this);
56
+ }
57
+
58
+ dialogueManager = ServiceLocator.GetService<IDialogueManager>();
59
+
60
+ if (dialogueManager != null)
61
+ dialogueManager.GetEnder().OnDialogueResolving += SetStartObjectNull;
62
+ }
63
+
64
+ /// <summary>
65
+ ///
66
+ /// </summary>
67
+ /// <typeparam name="T"></typeparam>
68
+ /// <param name="service"></param>
69
+ protected virtual void RegisterService<T>(T service) where T : class
70
+ {
71
+ if (!ServiceLocator.HasService<T>())
72
+ ServiceLocator.Register(service);
73
+ else
74
+ Destroy(gameObject);
75
+ }
76
+
77
+
78
+ /// <summary>
79
+ ///
80
+ /// </summary>
81
+ protected virtual void OnDisable()
82
+ {
83
+ if (dialogueManager != null)
84
+ dialogueManager.GetEnder().OnDialogueResolving -= SetStartObjectNull;
85
+ }
86
+
87
+
88
+ /// <inheritdoc/>
89
+ public virtual void RegisterObject(Talkable obj)
90
+ {
91
+ if (obj is Talkable talkable)
92
+ {
93
+ if (actors.Contains(talkable))
94
+ return;
95
+
96
+ actors.Add(talkable);
97
+
98
+ talkable.SubscribeToStartConversation(Evaluate);
99
+ }
100
+ else
101
+ UnityEngine.Debug.LogWarning("Object Tried To register to a Pooler that doesn't use it's type");
102
+ }
103
+
104
+ /// <inheritdoc/>
105
+ public virtual void UnregisterObject(Talkable obj)
106
+ {
107
+ actors.Remove(obj);
108
+
109
+ obj.UnsubscribeToStartConversation(Evaluate);
110
+ }
111
+
112
+ /// <summary>
113
+ ///
114
+ /// </summary>
115
+ /// <param name="talkable"></param>
116
+ /// <param name="Conversation"></param>
117
+ protected virtual void Evaluate(Talkable talkable, Dialogue[] Conversation)
118
+ {
119
+ startObject = talkable;
120
+
121
+ if (ServiceLocator.HasService<IDialogueManager>())
122
+ {
123
+ if (Conversation[0] != null)
124
+ ServiceLocator.GetService<IDialogueManager>().StartDialogue(talkable, Conversation);
125
+ else
126
+ ServiceLocator.GetService<IDialogueManager>().DebugNoCharacterDialogueCall(talkable);
127
+ }
128
+ else
129
+ UnityEngine.Debug.LogWarning($"ALERT: {ToString()}: ActorManager could not get {nameof(IDialogueManager)}!");
130
+ }
131
+
132
+
133
+ /// <inheritdoc/>
134
+ public virtual Talkable GetObjectByName(string name)
135
+ {
136
+ var actors = GetRegisteredObjects().OfType<Talkable>()
137
+ .Where(talkable => talkable.gameObject.name == name);
138
+
139
+ if (actors.Any())
140
+ return actors.First();
141
+ else if (name != tutorialCharacterFirstName && logActorsNotFound)
142
+ UnityEngine.Debug.Log($"REPORT: {ToString()}: Couldn't find actor: {name}.");
143
+
144
+ return null;
145
+ }
146
+
147
+ /// <inheritdoc/>
148
+ public virtual List<Talkable> GetRegisteredObjects() => actors;
149
+ }
150
150
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 7178ab45f3026ed459d425dd47e23743
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: 7178ab45f3026ed459d425dd47e23743
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/ActorOrganizer.cs CHANGED
@@ -1,94 +1,94 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using DREditor.Dialogues.LineReading;
4
- using DREditor.Dialogues.Loading;
5
- using DREditor.EventObjects;
6
- using DREditor.Services;
7
- using DREditor.Talkables;
8
- using UnityEngine;
9
-
10
- namespace DREditor.Actors
11
- {
12
- /// <summary>
13
- ///
14
- /// </summary>
15
- [ClassHeader("" + nameof(ILineProcessor) + ", " + nameof(ILineEndProcess) + ", " +
16
- nameof(ILoadToLineable) + ", " + nameof(ILoadToLineEnd) + ", " + nameof(IDialogueReaderCleanUp) + ", " +
17
- nameof(IToTitleScreen) +
18
- "\n\n")]
19
- public class ActorOrganizer : DialogueComponent, ILineProcessor, ILineEndProcess,
20
- ILoadToLineable, ILoadToLineEnd, IDialogueReaderCleanUp, IToTitleScreen
21
- {
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Header("")]
26
- [Divider]
27
- [Tooltip("")]
28
- [SerializeField] protected BoolWithEvent isProtagSpeaking = null;
29
-
30
- /// <summary>
31
- ///
32
- /// </summary>
33
- [Tooltip("")]
34
- [SerializeField] protected SelectableObjectWithEvent currentActor = null;
35
-
36
- /// <summary>
37
- ///
38
- /// </summary>
39
- [Tooltip("")]
40
- [SerializeField] protected SelectableObjectWithEvent lastActor = null;
41
-
42
-
43
- /// <summary>
44
- ///
45
- /// </summary>
46
- /// <param name="name"></param>
47
- protected virtual void SetCurrentActorByName(string name)
48
- {
49
- currentActor.SetValue((Actor)ServiceLocator.GetService<IObjectPooler<Talkable>>().GetObjectByName(name));
50
- }
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- /// <param name="currentLine"></param>
56
- protected virtual void SetLastActorFromLineData(Line currentLine = null)
57
- {
58
- if (!isProtagSpeaking.Value && !currentLine.DontPan)
59
- lastActor.SetValue((Actor)currentActor.Value);
60
- }
61
-
62
-
63
- /// <inheritdoc/>
64
- public virtual void LineProcess(Line currentLine)
65
- {
66
- if (currentLine.Speaker != null && !isProtagSpeaking.Value)
67
- SetCurrentActorByName(currentLine.Speaker.FirstName);
68
- }
69
-
70
- /// <inheritdoc/>
71
- public virtual void LineEndProcess(Line currentLine = null) => SetLastActorFromLineData(currentLine);
72
-
73
- /// <inheritdoc/>
74
- public virtual void OnLoadToLine(Line currentLine)
75
- {
76
- if (currentLine.Speaker != null)
77
- SetCurrentActorByName(currentLine.Speaker.FirstName);
78
- }
79
-
80
- /// <inheritdoc/>
81
- public virtual void OnLoadToLineEnd(Line currentLine) => SetLastActorFromLineData(currentLine);
82
-
83
- /// <inheritdoc/>
84
- public virtual void OnDialogueReaderCleanUp()
85
- {
86
- lastActor.SetValue(null);
87
-
88
- ToTitleScreen();
89
- }
90
-
91
- /// <inheritdoc/>
92
- public virtual void ToTitleScreen() => isProtagSpeaking.SetValue(false);
93
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.LineReading;
4
+ using DREditor.Dialogues.Loading;
5
+ using DREditor.EventObjects;
6
+ using DREditor.Services;
7
+ using DREditor.Talkables;
8
+ using UnityEngine;
9
+
10
+ namespace DREditor.Actors
11
+ {
12
+ /// <summary>
13
+ ///
14
+ /// </summary>
15
+ [ClassHeader("" + nameof(ILineProcessor) + ", " + nameof(ILineEndProcess) + ", " +
16
+ nameof(ILoadToLineable) + ", " + nameof(ILoadToLineEnd) + ", " + nameof(IDialogueReaderCleanUp) + ", " +
17
+ nameof(IToTitleScreen) +
18
+ "\n\n")]
19
+ public class ActorOrganizer : DialogueComponent, ILineProcessor, ILineEndProcess,
20
+ ILoadToLineable, ILoadToLineEnd, IDialogueReaderCleanUp, IToTitleScreen
21
+ {
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Header("")]
26
+ [Divider]
27
+ [Tooltip("")]
28
+ [SerializeField] protected BoolWithEvent isProtagSpeaking = null;
29
+
30
+ /// <summary>
31
+ ///
32
+ /// </summary>
33
+ [Tooltip("")]
34
+ [SerializeField] protected SelectableObjectWithEvent currentActor = null;
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ [Tooltip("")]
40
+ [SerializeField] protected SelectableObjectWithEvent lastActor = null;
41
+
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ /// <param name="name"></param>
47
+ protected virtual void SetCurrentActorByName(string name)
48
+ {
49
+ currentActor.SetValue((Actor)ServiceLocator.GetService<IObjectPooler<Talkable>>().GetObjectByName(name));
50
+ }
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ /// <param name="currentLine"></param>
56
+ protected virtual void SetLastActorFromLineData(Line currentLine = null)
57
+ {
58
+ if (!isProtagSpeaking.Value && !currentLine.DontPan)
59
+ lastActor.SetValue((Actor)currentActor.Value);
60
+ }
61
+
62
+
63
+ /// <inheritdoc/>
64
+ public virtual void LineProcess(Line currentLine)
65
+ {
66
+ if (currentLine.Speaker != null && !isProtagSpeaking.Value)
67
+ SetCurrentActorByName(currentLine.Speaker.FirstName);
68
+ }
69
+
70
+ /// <inheritdoc/>
71
+ public virtual void LineEndProcess(Line currentLine = null) => SetLastActorFromLineData(currentLine);
72
+
73
+ /// <inheritdoc/>
74
+ public virtual void OnLoadToLine(Line currentLine)
75
+ {
76
+ if (currentLine.Speaker != null)
77
+ SetCurrentActorByName(currentLine.Speaker.FirstName);
78
+ }
79
+
80
+ /// <inheritdoc/>
81
+ public virtual void OnLoadToLineEnd(Line currentLine) => SetLastActorFromLineData(currentLine);
82
+
83
+ /// <inheritdoc/>
84
+ public virtual void OnDialogueReaderCleanUp()
85
+ {
86
+ lastActor.SetValue(null);
87
+
88
+ ToTitleScreen();
89
+ }
90
+
91
+ /// <inheritdoc/>
92
+ public virtual void ToTitleScreen() => isProtagSpeaking.SetValue(false);
93
+ }
94
94
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 02c88a37ab748804e86dcf3bbee51981
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: 02c88a37ab748804e86dcf3bbee51981
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: