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
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Events;
|
|
4
|
-
using DREditor.Dialogues.Starting;
|
|
5
|
-
using DREditor.EventObjects;
|
|
6
|
-
using DREditor.Services;
|
|
7
|
-
using DREditor.Talkables;
|
|
8
|
-
using System.Collections;
|
|
9
|
-
using UnityEngine;
|
|
10
|
-
|
|
11
|
-
namespace DREditor.Actors.Implementation
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
[ClassHeader(nameof(IPreparableDialogueComponent) +
|
|
17
|
-
"\n\n")]
|
|
18
|
-
public class ActorFocusPrepare : DialogueComponent, IPreparableDialogueComponent
|
|
19
|
-
{
|
|
20
|
-
/// <summary>
|
|
21
|
-
///
|
|
22
|
-
/// </summary>
|
|
23
|
-
[Tooltip("")]
|
|
24
|
-
[SerializeField] protected float prepareOrder = 3;
|
|
25
|
-
|
|
26
|
-
/// <summary>
|
|
27
|
-
///
|
|
28
|
-
/// </summary>
|
|
29
|
-
[Tooltip("")]
|
|
30
|
-
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
31
|
-
|
|
32
|
-
/// <summary>
|
|
33
|
-
///
|
|
34
|
-
/// </summary>
|
|
35
|
-
[Tooltip("")]
|
|
36
|
-
[SerializeField] protected SelectableObjectWithEvent lastActor = null;
|
|
37
|
-
|
|
38
|
-
/// <summary>
|
|
39
|
-
///
|
|
40
|
-
/// </summary>
|
|
41
|
-
[Tooltip("")]
|
|
42
|
-
[SerializeField] protected string panToTalkableEventString = "PanToTalkable";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
public float Order { get => prepareOrder; }
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/// <inheritdoc/>
|
|
49
|
-
public virtual bool UseRoutineToPrepare() => false;
|
|
50
|
-
|
|
51
|
-
/// <inheritdoc/>
|
|
52
|
-
public virtual void Prepare() => PrepareFocusing();
|
|
53
|
-
|
|
54
|
-
/// <inheritdoc/>
|
|
55
|
-
public virtual IEnumerator PrepareRoutine()
|
|
56
|
-
{
|
|
57
|
-
Prepare();
|
|
58
|
-
|
|
59
|
-
yield break;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/// <summary>
|
|
63
|
-
///
|
|
64
|
-
/// </summary>
|
|
65
|
-
protected virtual void PrepareFocusing()
|
|
66
|
-
{
|
|
67
|
-
Talkable selectedObject = ServiceLocator.GetService<DialogueObjectManager>().GetStartObject() as Talkable;
|
|
68
|
-
|
|
69
|
-
if (selectedObject != null && selectedObject is Actor actor && actor != null)
|
|
70
|
-
actor.GetComponent<LayerHandler>().ToggleRender();
|
|
71
|
-
|
|
72
|
-
PanToFirstObjectInDialogue(selectedObject);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/// <summary>
|
|
76
|
-
///
|
|
77
|
-
/// </summary>
|
|
78
|
-
/// <param name="selectedObject"></param>
|
|
79
|
-
protected virtual void PanToFirstObjectInDialogue(Talkable selectedObject)
|
|
80
|
-
{
|
|
81
|
-
if (selectedObject != null)
|
|
82
|
-
if (selectedObject is Actor actor)
|
|
83
|
-
PanToFirstActorInDialogue(actor);
|
|
84
|
-
else if(selectedObject is Talkable item)
|
|
85
|
-
DialogueEventSystem.TriggerEvent(panToTalkableEventString, item);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/// <summary>
|
|
89
|
-
///
|
|
90
|
-
/// </summary>
|
|
91
|
-
/// <param name="actor"></param>
|
|
92
|
-
protected virtual void PanToFirstActorInDialogue(Actor actor)
|
|
93
|
-
{
|
|
94
|
-
if (!isLoadingFile.Value)
|
|
95
|
-
DialogueEventSystem.TriggerEvent(panToTalkableEventString, actor);
|
|
96
|
-
|
|
97
|
-
if (actor != null)
|
|
98
|
-
actor.GetComponent<LayerHandler>().FocusActor();
|
|
99
|
-
|
|
100
|
-
lastActor.SetValue(actor);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Events;
|
|
4
|
+
using DREditor.Dialogues.Starting;
|
|
5
|
+
using DREditor.EventObjects;
|
|
6
|
+
using DREditor.Services;
|
|
7
|
+
using DREditor.Talkables;
|
|
8
|
+
using System.Collections;
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
|
|
11
|
+
namespace DREditor.Actors.Implementation
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
[ClassHeader(nameof(IPreparableDialogueComponent) +
|
|
17
|
+
"\n\n")]
|
|
18
|
+
public class ActorFocusPrepare : DialogueComponent, IPreparableDialogueComponent
|
|
19
|
+
{
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected float prepareOrder = 3;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected SelectableObjectWithEvent lastActor = null;
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
[Tooltip("")]
|
|
42
|
+
[SerializeField] protected string panToTalkableEventString = "PanToTalkable";
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
public float Order { get => prepareOrder; }
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/// <inheritdoc/>
|
|
49
|
+
public virtual bool UseRoutineToPrepare() => false;
|
|
50
|
+
|
|
51
|
+
/// <inheritdoc/>
|
|
52
|
+
public virtual void Prepare() => PrepareFocusing();
|
|
53
|
+
|
|
54
|
+
/// <inheritdoc/>
|
|
55
|
+
public virtual IEnumerator PrepareRoutine()
|
|
56
|
+
{
|
|
57
|
+
Prepare();
|
|
58
|
+
|
|
59
|
+
yield break;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// <summary>
|
|
63
|
+
///
|
|
64
|
+
/// </summary>
|
|
65
|
+
protected virtual void PrepareFocusing()
|
|
66
|
+
{
|
|
67
|
+
Talkable selectedObject = ServiceLocator.GetService<DialogueObjectManager>().GetStartObject() as Talkable;
|
|
68
|
+
|
|
69
|
+
if (selectedObject != null && selectedObject is Actor actor && actor != null)
|
|
70
|
+
actor.GetComponent<LayerHandler>().ToggleRender();
|
|
71
|
+
|
|
72
|
+
PanToFirstObjectInDialogue(selectedObject);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// <summary>
|
|
76
|
+
///
|
|
77
|
+
/// </summary>
|
|
78
|
+
/// <param name="selectedObject"></param>
|
|
79
|
+
protected virtual void PanToFirstObjectInDialogue(Talkable selectedObject)
|
|
80
|
+
{
|
|
81
|
+
if (selectedObject != null)
|
|
82
|
+
if (selectedObject is Actor actor)
|
|
83
|
+
PanToFirstActorInDialogue(actor);
|
|
84
|
+
else if(selectedObject is Talkable item)
|
|
85
|
+
DialogueEventSystem.TriggerEvent(panToTalkableEventString, item);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/// <summary>
|
|
89
|
+
///
|
|
90
|
+
/// </summary>
|
|
91
|
+
/// <param name="actor"></param>
|
|
92
|
+
protected virtual void PanToFirstActorInDialogue(Actor actor)
|
|
93
|
+
{
|
|
94
|
+
if (!isLoadingFile.Value)
|
|
95
|
+
DialogueEventSystem.TriggerEvent(panToTalkableEventString, actor);
|
|
96
|
+
|
|
97
|
+
if (actor != null)
|
|
98
|
+
actor.GetComponent<LayerHandler>().FocusActor();
|
|
99
|
+
|
|
100
|
+
lastActor.SetValue(actor);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
103
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: d4e9fae2bf4c0cc48993b625e503d3bf
|
|
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: d4e9fae2bf4c0cc48993b625e503d3bf
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Ending;
|
|
4
|
-
using DREditor.EventObjects;
|
|
5
|
-
using DREditor.Services;
|
|
6
|
-
using System.Collections;
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
|
|
9
|
-
namespace DREditor.Actors.Implementation
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
[ClassHeader(nameof(IResolvableDialogueComponent) +
|
|
15
|
-
"\n\n")]
|
|
16
|
-
public class ActorFocusResolve : DialogueComponent, IResolvableDialogueComponent
|
|
17
|
-
{
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] protected float resolveOrder = 1;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Tooltip("")]
|
|
28
|
-
[SerializeField] protected SelectableObjectWithEvent lastActor = null;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
public float Order { get => resolveOrder; }
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/// <inheritdoc/>
|
|
35
|
-
public virtual bool UseRoutineToResolve() => false;
|
|
36
|
-
|
|
37
|
-
/// <inheritdoc/>
|
|
38
|
-
public virtual IEnumerator ResolveRoutine()
|
|
39
|
-
{
|
|
40
|
-
Resolve();
|
|
41
|
-
|
|
42
|
-
yield break;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/// <inheritdoc/>
|
|
46
|
-
public virtual void Resolve()
|
|
47
|
-
{
|
|
48
|
-
SetActorToThreeDState((Actor)lastActor.Value);
|
|
49
|
-
|
|
50
|
-
if (ServiceLocator.GetService<DialogueObjectManager>().GetStartObject() is Actor actor)
|
|
51
|
-
SetActorToThreeDState(actor);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/// <summary>
|
|
55
|
-
///
|
|
56
|
-
/// </summary>
|
|
57
|
-
/// <param name="actor"></param>
|
|
58
|
-
protected virtual void SetActorToThreeDState(Actor actor)
|
|
59
|
-
{
|
|
60
|
-
if (actor != null && !actor.GetComponentInChildren<MeshRenderer>().enabled)
|
|
61
|
-
{
|
|
62
|
-
actor.GetComponent<LayerHandler>().UnFocusActor();
|
|
63
|
-
|
|
64
|
-
actor.GetComponent<LayerHandler>().ToggleRender();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Ending;
|
|
4
|
+
using DREditor.EventObjects;
|
|
5
|
+
using DREditor.Services;
|
|
6
|
+
using System.Collections;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Actors.Implementation
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader(nameof(IResolvableDialogueComponent) +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class ActorFocusResolve : DialogueComponent, IResolvableDialogueComponent
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected float resolveOrder = 1;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected SelectableObjectWithEvent lastActor = null;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
public float Order { get => resolveOrder; }
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/// <inheritdoc/>
|
|
35
|
+
public virtual bool UseRoutineToResolve() => false;
|
|
36
|
+
|
|
37
|
+
/// <inheritdoc/>
|
|
38
|
+
public virtual IEnumerator ResolveRoutine()
|
|
39
|
+
{
|
|
40
|
+
Resolve();
|
|
41
|
+
|
|
42
|
+
yield break;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// <inheritdoc/>
|
|
46
|
+
public virtual void Resolve()
|
|
47
|
+
{
|
|
48
|
+
SetActorToThreeDState((Actor)lastActor.Value);
|
|
49
|
+
|
|
50
|
+
if (ServiceLocator.GetService<DialogueObjectManager>().GetStartObject() is Actor actor)
|
|
51
|
+
SetActorToThreeDState(actor);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
///
|
|
56
|
+
/// </summary>
|
|
57
|
+
/// <param name="actor"></param>
|
|
58
|
+
protected virtual void SetActorToThreeDState(Actor actor)
|
|
59
|
+
{
|
|
60
|
+
if (actor != null && !actor.GetComponentInChildren<MeshRenderer>().enabled)
|
|
61
|
+
{
|
|
62
|
+
actor.GetComponent<LayerHandler>().UnFocusActor();
|
|
63
|
+
|
|
64
|
+
actor.GetComponent<LayerHandler>().ToggleRender();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
68
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 204519124e231ae4fa8cfa244307190d
|
|
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: 204519124e231ae4fa8cfa244307190d
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Events;
|
|
4
|
-
using DREditor.Dialogues.LineReading;
|
|
5
|
-
using DREditor.Dialogues.Loading;
|
|
6
|
-
using DREditor.EventObjects;
|
|
7
|
-
using DREditor.Talkables;
|
|
8
|
-
using System.Collections;
|
|
9
|
-
using UnityEngine;
|
|
10
|
-
|
|
11
|
-
namespace DREditor.Actors.Implementation
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
/// <remarks>
|
|
17
|
-
///
|
|
18
|
-
/// </remarks>
|
|
19
|
-
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(ILineProcessorRoutine) + ", " + nameof(ILoadToLineable) +
|
|
20
|
-
"\n\n")]
|
|
21
|
-
public class ActorSpriteChanger : DialogueComponent, ILineProcessorRoutine, ILoadToLineable
|
|
22
|
-
{
|
|
23
|
-
/// <summary>
|
|
24
|
-
///
|
|
25
|
-
/// </summary>
|
|
26
|
-
[Tooltip("")]
|
|
27
|
-
[SerializeField] protected WorldSpriteChanger changer = null;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
[Header("")]
|
|
34
|
-
[Divider]
|
|
35
|
-
[Tooltip("")]
|
|
36
|
-
[SerializeField] protected SelectableObjectWithEvent currentActor = null;
|
|
37
|
-
|
|
38
|
-
/// <summary>
|
|
39
|
-
///
|
|
40
|
-
/// </summary>
|
|
41
|
-
[Tooltip("")]
|
|
42
|
-
[SerializeField] protected BoolWithEvent inFastForwardMode = null;
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
[Tooltip("")]
|
|
48
|
-
[SerializeField] protected BoolWithEvent isProtagSpeaking = null;
|
|
49
|
-
|
|
50
|
-
/// <summary>
|
|
51
|
-
///
|
|
52
|
-
/// </summary>
|
|
53
|
-
[Tooltip("")]
|
|
54
|
-
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/// <inheritdoc/>
|
|
58
|
-
public virtual bool ShouldProcess(Line currentLine)
|
|
59
|
-
{
|
|
60
|
-
bool lastActorPresent = currentLine.ContainsEventType<LastActorSprite>();
|
|
61
|
-
|
|
62
|
-
bool expressionValid = currentLine.Expression != null && currentLine.Expression.Sprite != null;
|
|
63
|
-
|
|
64
|
-
bool spriteShouldChange = expressionValid && !isProtagSpeaking.Value;
|
|
65
|
-
|
|
66
|
-
return lastActorPresent || spriteShouldChange;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/// <inheritdoc/>
|
|
70
|
-
public virtual IEnumerator LineProcessRoutine(Line currentLine) => ChangeLineSprites(currentLine);
|
|
71
|
-
|
|
72
|
-
/// <summary>
|
|
73
|
-
///
|
|
74
|
-
/// </summary>
|
|
75
|
-
/// <param name="currentLine"></param>
|
|
76
|
-
protected virtual IEnumerator ChangeLineSprites(Line currentLine)
|
|
77
|
-
{
|
|
78
|
-
Talkable currentTalkable = (Talkable)currentActor.Value;
|
|
79
|
-
|
|
80
|
-
yield return WaitForSpriteChangeEventFinished<LastActorSprite>(currentLine, isProtagSpeaking.Value);
|
|
81
|
-
|
|
82
|
-
yield return ChangeWorldSprite(currentLine, currentTalkable);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/// <summary>
|
|
86
|
-
///
|
|
87
|
-
/// </summary>
|
|
88
|
-
/// <typeparam name="T"></typeparam>
|
|
89
|
-
/// <param name="currentLine"></param>
|
|
90
|
-
/// <param name="additionalCondition"></param>
|
|
91
|
-
protected virtual IEnumerator WaitForSpriteChangeEventFinished<T>(Line currentLine, bool additionalCondition = true)
|
|
92
|
-
{
|
|
93
|
-
if (currentLine.ContainsEventType<T>() && !isLoadingFile.Value && additionalCondition)
|
|
94
|
-
{
|
|
95
|
-
var changers = FindObjectsByType<WorldSpriteChanger>();
|
|
96
|
-
|
|
97
|
-
foreach (var changer in changers)
|
|
98
|
-
if (changer.IsActivelyChanging())
|
|
99
|
-
yield return changer.WaitForSpriteToFinishChanging();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/// <summary>
|
|
104
|
-
///
|
|
105
|
-
/// </summary>
|
|
106
|
-
/// <param name="currentLine"></param>
|
|
107
|
-
/// <param name="currentActor"></param>
|
|
108
|
-
/// <param name="waitToFinish"></param>
|
|
109
|
-
protected virtual IEnumerator ChangeWorldSprite(Line currentLine, Talkable currentActor, bool waitToFinish = true)
|
|
110
|
-
{
|
|
111
|
-
bool expressionIsValid = currentLine.Expression != null && currentLine.Expression.Sprite != null;
|
|
112
|
-
|
|
113
|
-
if (!isProtagSpeaking.Value && expressionIsValid)
|
|
114
|
-
{
|
|
115
|
-
Material expressionMaterial = currentLine.Expression.Sprite;
|
|
116
|
-
|
|
117
|
-
Sprite expressionSprite = currentLine.Speaker.Sprites[currentLine.ExpressionNumber - 1].Sprite;
|
|
118
|
-
|
|
119
|
-
changer.WorldSpriteChange((Actor)currentActor, expressionMaterial, expressionSprite);
|
|
120
|
-
|
|
121
|
-
if (waitToFinish)
|
|
122
|
-
yield return changer.WaitForSpriteToFinishChanging();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/// <inheritdoc/>
|
|
127
|
-
public virtual void OnLoadToLine(Line currentLine)
|
|
128
|
-
=> StartCoroutine(ChangeWorldSprite(currentLine, (Talkable)currentActor.Value, false));
|
|
129
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Events;
|
|
4
|
+
using DREditor.Dialogues.LineReading;
|
|
5
|
+
using DREditor.Dialogues.Loading;
|
|
6
|
+
using DREditor.EventObjects;
|
|
7
|
+
using DREditor.Talkables;
|
|
8
|
+
using System.Collections;
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
|
|
11
|
+
namespace DREditor.Actors.Implementation
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
/// <remarks>
|
|
17
|
+
///
|
|
18
|
+
/// </remarks>
|
|
19
|
+
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(ILineProcessorRoutine) + ", " + nameof(ILoadToLineable) +
|
|
20
|
+
"\n\n")]
|
|
21
|
+
public class ActorSpriteChanger : DialogueComponent, ILineProcessorRoutine, ILoadToLineable
|
|
22
|
+
{
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[SerializeField] protected WorldSpriteChanger changer = null;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
[Header("")]
|
|
34
|
+
[Divider]
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected SelectableObjectWithEvent currentActor = null;
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
[Tooltip("")]
|
|
42
|
+
[SerializeField] protected BoolWithEvent inFastForwardMode = null;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
[Tooltip("")]
|
|
48
|
+
[SerializeField] protected BoolWithEvent isProtagSpeaking = null;
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Tooltip("")]
|
|
54
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/// <inheritdoc/>
|
|
58
|
+
public virtual bool ShouldProcess(Line currentLine)
|
|
59
|
+
{
|
|
60
|
+
bool lastActorPresent = currentLine.ContainsEventType<LastActorSprite>();
|
|
61
|
+
|
|
62
|
+
bool expressionValid = currentLine.Expression != null && currentLine.Expression.Sprite != null;
|
|
63
|
+
|
|
64
|
+
bool spriteShouldChange = expressionValid && !isProtagSpeaking.Value;
|
|
65
|
+
|
|
66
|
+
return lastActorPresent || spriteShouldChange;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// <inheritdoc/>
|
|
70
|
+
public virtual IEnumerator LineProcessRoutine(Line currentLine) => ChangeLineSprites(currentLine);
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
///
|
|
74
|
+
/// </summary>
|
|
75
|
+
/// <param name="currentLine"></param>
|
|
76
|
+
protected virtual IEnumerator ChangeLineSprites(Line currentLine)
|
|
77
|
+
{
|
|
78
|
+
Talkable currentTalkable = (Talkable)currentActor.Value;
|
|
79
|
+
|
|
80
|
+
yield return WaitForSpriteChangeEventFinished<LastActorSprite>(currentLine, isProtagSpeaking.Value);
|
|
81
|
+
|
|
82
|
+
yield return ChangeWorldSprite(currentLine, currentTalkable);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/// <summary>
|
|
86
|
+
///
|
|
87
|
+
/// </summary>
|
|
88
|
+
/// <typeparam name="T"></typeparam>
|
|
89
|
+
/// <param name="currentLine"></param>
|
|
90
|
+
/// <param name="additionalCondition"></param>
|
|
91
|
+
protected virtual IEnumerator WaitForSpriteChangeEventFinished<T>(Line currentLine, bool additionalCondition = true)
|
|
92
|
+
{
|
|
93
|
+
if (currentLine.ContainsEventType<T>() && !isLoadingFile.Value && additionalCondition)
|
|
94
|
+
{
|
|
95
|
+
var changers = FindObjectsByType<WorldSpriteChanger>();
|
|
96
|
+
|
|
97
|
+
foreach (var changer in changers)
|
|
98
|
+
if (changer.IsActivelyChanging())
|
|
99
|
+
yield return changer.WaitForSpriteToFinishChanging();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// <summary>
|
|
104
|
+
///
|
|
105
|
+
/// </summary>
|
|
106
|
+
/// <param name="currentLine"></param>
|
|
107
|
+
/// <param name="currentActor"></param>
|
|
108
|
+
/// <param name="waitToFinish"></param>
|
|
109
|
+
protected virtual IEnumerator ChangeWorldSprite(Line currentLine, Talkable currentActor, bool waitToFinish = true)
|
|
110
|
+
{
|
|
111
|
+
bool expressionIsValid = currentLine.Expression != null && currentLine.Expression.Sprite != null;
|
|
112
|
+
|
|
113
|
+
if (!isProtagSpeaking.Value && expressionIsValid)
|
|
114
|
+
{
|
|
115
|
+
Material expressionMaterial = currentLine.Expression.Sprite;
|
|
116
|
+
|
|
117
|
+
Sprite expressionSprite = currentLine.Speaker.Sprites[currentLine.ExpressionNumber - 1].Sprite;
|
|
118
|
+
|
|
119
|
+
changer.WorldSpriteChange((Actor)currentActor, expressionMaterial, expressionSprite);
|
|
120
|
+
|
|
121
|
+
if (waitToFinish)
|
|
122
|
+
yield return changer.WaitForSpriteToFinishChanging();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/// <inheritdoc/>
|
|
127
|
+
public virtual void OnLoadToLine(Line currentLine)
|
|
128
|
+
=> StartCoroutine(ChangeWorldSprite(currentLine, (Talkable)currentActor.Value, false));
|
|
129
|
+
}
|
|
130
130
|
}
|