net.dreditor.nameplates 0.0.0-stage → 0.1.6
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/DREditor.Nameplates.asmdef +16 -0
- package/DREditor.Nameplates.asmdef.meta +7 -0
- package/DialogueNameplateHandler.cs +81 -0
- package/DialogueNameplateHandler.cs.meta +11 -0
- package/ITransparentableNameplate.cs +15 -0
- package/ITransparentableNameplate.cs.meta +11 -0
- package/NameplateHandler.cs +77 -0
- package/NameplateHandler.cs.meta +11 -0
- package/Samples/AllNameplatesTransparent.asset +14 -0
- package/Samples/AllNameplatesTransparent.asset.meta +8 -0
- package/Samples/CGNameplateTexture.asset +21 -0
- package/Samples/CGNameplateTexture.asset.meta +8 -0
- package/Samples/CG_Nameplate_Handler.prefab +57 -0
- package/Samples/CG_Nameplate_Handler.prefab.meta +7 -0
- package/Samples/Dialogue_Nameplate_Handler.prefab +133 -0
- package/Samples/Dialogue_Nameplate_Handler.prefab.meta +7 -0
- package/Samples/NameplateTexture.asset +21 -0
- package/Samples/NameplateTexture.asset.meta +8 -0
- package/Samples/Set_Nameplate_On_Dialogue_Start.prefab +47 -0
- package/Samples/Set_Nameplate_On_Dialogue_Start.prefab.meta +7 -0
- package/Samples/TrialNameplateTexture.asset +21 -0
- package/Samples/TrialNameplateTexture.asset.meta +8 -0
- package/Samples/Trial_Dialogue_Nameplate_Handler.prefab +133 -0
- package/Samples/Trial_Dialogue_Nameplate_Handler.prefab.meta +7 -0
- package/Samples.meta +8 -0
- package/SetNameplateOnDialogueStart.cs +74 -0
- package/SetNameplateOnDialogueStart.cs.meta +11 -0
- package/TrialDialogueNameplateHandler.cs +20 -0
- package/TrialDialogueNameplateHandler.cs.meta +11 -0
- package/package.json +34 -6
- package/package.json.meta +7 -0
- package/README.md +0 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DREditor.Nameplates",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"DREditor"
|
|
6
|
+
],
|
|
7
|
+
"includePlatforms": [],
|
|
8
|
+
"excludePlatforms": [],
|
|
9
|
+
"allowUnsafeCode": false,
|
|
10
|
+
"overrideReferences": false,
|
|
11
|
+
"precompiledReferences": [],
|
|
12
|
+
"autoReferenced": true,
|
|
13
|
+
"defineConstraints": [],
|
|
14
|
+
"versionDefines": [],
|
|
15
|
+
"noEngineReferences": false
|
|
16
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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.EventObjects;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Nameplates
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ClassHeader(nameof(ILineProcessor) + ", " + nameof(ITransparentableNameplate) + ", " + nameof(ISceneEventListener) +
|
|
13
|
+
"\n\n")]
|
|
14
|
+
public class DialogueNameplateHandler : NameplateHandler, ITransparentableNameplate, ISceneEventListener
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Header("")]
|
|
20
|
+
[Divider]
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected Texture2D transparentImage = null;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected SceneEvent allNameplatesTransparent = null;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[Header("")]
|
|
35
|
+
[Divider]
|
|
36
|
+
[Tooltip("")]
|
|
37
|
+
[SerializeField] protected bool setNameTransparentIfTutorial = true;
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Tooltip("")]
|
|
43
|
+
[SerializeField] protected string tutorialCharacterFirstName = "Tutorial";
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
///
|
|
48
|
+
/// </summary>
|
|
49
|
+
protected virtual void OnEnable()
|
|
50
|
+
{
|
|
51
|
+
if (allNameplatesTransparent != null)
|
|
52
|
+
allNameplatesTransparent.RegisterListener(this);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
///
|
|
57
|
+
/// </summary>
|
|
58
|
+
protected virtual void OnDisable()
|
|
59
|
+
{
|
|
60
|
+
if (allNameplatesTransparent != null)
|
|
61
|
+
allNameplatesTransparent.UnregisterListener(this);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// <inheritdoc/>
|
|
65
|
+
public override void EvaluateNameplate(Line currentLine)
|
|
66
|
+
{
|
|
67
|
+
bool tutorialIsLineSpeaker = currentLine.Speaker == null
|
|
68
|
+
|| currentLine.Speaker.FirstName.Contains(tutorialCharacterFirstName);
|
|
69
|
+
|
|
70
|
+
if (setNameTransparentIfTutorial && tutorialIsLineSpeaker)
|
|
71
|
+
SetNameTransparent();
|
|
72
|
+
else
|
|
73
|
+
base.EvaluateNameplate(currentLine);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/// <inheritdoc/>
|
|
77
|
+
public virtual void OnEventRaised() => SetNameTransparent();
|
|
78
|
+
|
|
79
|
+
public virtual void SetNameTransparent() => SetTexture(transparentImage);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
|
|
3
|
+
namespace DREditor.Nameplates
|
|
4
|
+
{
|
|
5
|
+
/// <summary>
|
|
6
|
+
///
|
|
7
|
+
/// </summary>
|
|
8
|
+
public interface ITransparentableNameplate
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
void SetNameTransparent();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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.EventObjects;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Nameplates
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(ILineProcessor) +
|
|
13
|
+
"\n\n")]
|
|
14
|
+
public class NameplateHandler : DialogueComponent, ILineProcessor
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Tooltip("")]
|
|
20
|
+
[SerializeField] protected TextureWithEvent textureEvent = null;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
protected virtual void Start() => CheckIfNameplateValid();
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
///
|
|
30
|
+
/// </summary>
|
|
31
|
+
protected virtual void CheckIfNameplateValid()
|
|
32
|
+
{
|
|
33
|
+
if (textureEvent == null)
|
|
34
|
+
UnityEngine.Debug.LogError("Nameplate Handler on GameObject: "
|
|
35
|
+
+ gameObject.name + " does not have it's graphic assigned!");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/// <inheritdoc/>
|
|
40
|
+
public virtual void LineProcess(Line currentLine) => EvaluateNameplate(currentLine);
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
///
|
|
44
|
+
/// </summary>
|
|
45
|
+
/// <param name="currentLine"></param>
|
|
46
|
+
public virtual void EvaluateNameplate(Line currentLine) => SetNameplate(currentLine);
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
///
|
|
50
|
+
/// </summary>
|
|
51
|
+
/// <param name="currentLine"></param>
|
|
52
|
+
public virtual void SetNameplate(Line currentLine)
|
|
53
|
+
{
|
|
54
|
+
if (currentLine == null || currentLine.Speaker == null || textureEvent == null)
|
|
55
|
+
return;
|
|
56
|
+
|
|
57
|
+
if (currentLine.AliasNumber != 0)
|
|
58
|
+
SetTexture(currentLine.Speaker.Aliases[currentLine.AliasNumber - 1].Nameplate);
|
|
59
|
+
else if (currentLine.Speaker.Nameplate != null)
|
|
60
|
+
SetTexture(currentLine.Speaker.Nameplate);
|
|
61
|
+
else
|
|
62
|
+
UnityEngine.Debug.LogWarning($"{ToString()}: failed to evaluate nameplate");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// <summary>
|
|
66
|
+
///
|
|
67
|
+
/// </summary>
|
|
68
|
+
/// <param name="texture"></param>
|
|
69
|
+
protected virtual void SetTexture(Texture2D texture)
|
|
70
|
+
{
|
|
71
|
+
if (textureEvent.Value == texture)
|
|
72
|
+
textureEvent.Invoke();
|
|
73
|
+
else
|
|
74
|
+
textureEvent.SetValue(texture);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: 1e8ba631faf0be14cb532632a1b2567f, type: 3}
|
|
13
|
+
m_Name: AllNameplatesTransparent
|
|
14
|
+
m_EditorClassIdentifier:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: 1b6ed62193d75184fb7ffa5d4a2c75dd, type: 3}
|
|
13
|
+
m_Name: CGNameplateTexture
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
debug: 0
|
|
16
|
+
alwaysInvokeOnSetValue: 1
|
|
17
|
+
OnChange:
|
|
18
|
+
m_PersistentCalls:
|
|
19
|
+
m_Calls: []
|
|
20
|
+
InitialValue: {fileID: 0}
|
|
21
|
+
_value: {fileID: 0}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &4619228513735807809
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 4619228513735807808}
|
|
12
|
+
- component: {fileID: 4619228513735807811}
|
|
13
|
+
m_Layer: 5
|
|
14
|
+
m_Name: CG_Nameplate_Handler
|
|
15
|
+
m_TagString: Untagged
|
|
16
|
+
m_Icon: {fileID: 0}
|
|
17
|
+
m_NavMeshLayer: 0
|
|
18
|
+
m_StaticEditorFlags: 0
|
|
19
|
+
m_IsActive: 1
|
|
20
|
+
--- !u!224 &4619228513735807808
|
|
21
|
+
RectTransform:
|
|
22
|
+
m_ObjectHideFlags: 0
|
|
23
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
24
|
+
m_PrefabInstance: {fileID: 0}
|
|
25
|
+
m_PrefabAsset: {fileID: 0}
|
|
26
|
+
m_GameObject: {fileID: 4619228513735807809}
|
|
27
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
28
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
30
|
+
m_ConstrainProportionsScale: 0
|
|
31
|
+
m_Children: []
|
|
32
|
+
m_Father: {fileID: 0}
|
|
33
|
+
m_RootOrder: 0
|
|
34
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
35
|
+
m_AnchorMin: {x: 0.5, y: 0.5}
|
|
36
|
+
m_AnchorMax: {x: 0.5, y: 0.5}
|
|
37
|
+
m_AnchoredPosition: {x: 0, y: 0}
|
|
38
|
+
m_SizeDelta: {x: 100, y: 100}
|
|
39
|
+
m_Pivot: {x: 0.5, y: 0.5}
|
|
40
|
+
--- !u!114 &4619228513735807811
|
|
41
|
+
MonoBehaviour:
|
|
42
|
+
m_ObjectHideFlags: 0
|
|
43
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
44
|
+
m_PrefabInstance: {fileID: 0}
|
|
45
|
+
m_PrefabAsset: {fileID: 0}
|
|
46
|
+
m_GameObject: {fileID: 4619228513735807809}
|
|
47
|
+
m_Enabled: 1
|
|
48
|
+
m_EditorHideFlags: 0
|
|
49
|
+
m_Script: {fileID: 11500000, guid: be61f8bf585533e4cbfa5a0473678d1f, type: 3}
|
|
50
|
+
m_Name:
|
|
51
|
+
m_EditorClassIdentifier:
|
|
52
|
+
textureEvent: {fileID: 11400000, guid: ec7708d2ca7ca7e4b88afeda9156bb70, type: 2}
|
|
53
|
+
transparentImage: {fileID: 2800000, guid: efdf3526fbd9585449342947534cd679, type: 3}
|
|
54
|
+
allNameplatesTransparent: {fileID: 11400000, guid: d8ab726e6cde03241857a4c7b597b8ec,
|
|
55
|
+
type: 2}
|
|
56
|
+
setNameTransparentIfTutorial: 1
|
|
57
|
+
tutorialCharacterFirstName: Tutorial
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &3576680000614226933
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 3576680000614226923}
|
|
12
|
+
- component: {fileID: 3576680000614226932}
|
|
13
|
+
m_Layer: 0
|
|
14
|
+
m_Name: Dialogue_Nameplate_Handler
|
|
15
|
+
m_TagString: Untagged
|
|
16
|
+
m_Icon: {fileID: 0}
|
|
17
|
+
m_NavMeshLayer: 0
|
|
18
|
+
m_StaticEditorFlags: 0
|
|
19
|
+
m_IsActive: 1
|
|
20
|
+
--- !u!4 &3576680000614226923
|
|
21
|
+
Transform:
|
|
22
|
+
m_ObjectHideFlags: 0
|
|
23
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
24
|
+
m_PrefabInstance: {fileID: 0}
|
|
25
|
+
m_PrefabAsset: {fileID: 0}
|
|
26
|
+
m_GameObject: {fileID: 3576680000614226933}
|
|
27
|
+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
28
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
30
|
+
m_ConstrainProportionsScale: 0
|
|
31
|
+
m_Children:
|
|
32
|
+
- {fileID: 6152183697635635083}
|
|
33
|
+
m_Father: {fileID: 0}
|
|
34
|
+
m_RootOrder: 0
|
|
35
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
36
|
+
--- !u!114 &3576680000614226932
|
|
37
|
+
MonoBehaviour:
|
|
38
|
+
m_ObjectHideFlags: 0
|
|
39
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
40
|
+
m_PrefabInstance: {fileID: 0}
|
|
41
|
+
m_PrefabAsset: {fileID: 0}
|
|
42
|
+
m_GameObject: {fileID: 3576680000614226933}
|
|
43
|
+
m_Enabled: 1
|
|
44
|
+
m_EditorHideFlags: 0
|
|
45
|
+
m_Script: {fileID: 11500000, guid: be61f8bf585533e4cbfa5a0473678d1f, type: 3}
|
|
46
|
+
m_Name:
|
|
47
|
+
m_EditorClassIdentifier:
|
|
48
|
+
textureEvent: {fileID: 11400000, guid: 9d4d1777b7ec77e4c8c35932964242f3, type: 2}
|
|
49
|
+
transparentImage: {fileID: 2800000, guid: efdf3526fbd9585449342947534cd679, type: 3}
|
|
50
|
+
allNameplatesTransparent: {fileID: 11400000, guid: d8ab726e6cde03241857a4c7b597b8ec,
|
|
51
|
+
type: 2}
|
|
52
|
+
setNameTransparentIfTutorial: 1
|
|
53
|
+
tutorialCharacterFirstName: Tutorial
|
|
54
|
+
--- !u!1001 &3470307483308625010
|
|
55
|
+
PrefabInstance:
|
|
56
|
+
m_ObjectHideFlags: 0
|
|
57
|
+
serializedVersion: 2
|
|
58
|
+
m_Modification:
|
|
59
|
+
m_TransformParent: {fileID: 3576680000614226923}
|
|
60
|
+
m_Modifications:
|
|
61
|
+
- target: {fileID: 7298628825334211462, guid: 60b11786261d1554799d05bae08d27e1,
|
|
62
|
+
type: 3}
|
|
63
|
+
propertyPath: nameplateHandler
|
|
64
|
+
value:
|
|
65
|
+
objectReference: {fileID: 3576680000614226932}
|
|
66
|
+
- target: {fileID: 7298628825334211576, guid: 60b11786261d1554799d05bae08d27e1,
|
|
67
|
+
type: 3}
|
|
68
|
+
propertyPath: m_Name
|
|
69
|
+
value: Set_Nameplate_On_Dialogue_Start
|
|
70
|
+
objectReference: {fileID: 0}
|
|
71
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
72
|
+
type: 3}
|
|
73
|
+
propertyPath: m_RootOrder
|
|
74
|
+
value: 0
|
|
75
|
+
objectReference: {fileID: 0}
|
|
76
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
77
|
+
type: 3}
|
|
78
|
+
propertyPath: m_LocalPosition.x
|
|
79
|
+
value: 0
|
|
80
|
+
objectReference: {fileID: 0}
|
|
81
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
82
|
+
type: 3}
|
|
83
|
+
propertyPath: m_LocalPosition.y
|
|
84
|
+
value: 0
|
|
85
|
+
objectReference: {fileID: 0}
|
|
86
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
87
|
+
type: 3}
|
|
88
|
+
propertyPath: m_LocalPosition.z
|
|
89
|
+
value: 0
|
|
90
|
+
objectReference: {fileID: 0}
|
|
91
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
92
|
+
type: 3}
|
|
93
|
+
propertyPath: m_LocalRotation.w
|
|
94
|
+
value: 1
|
|
95
|
+
objectReference: {fileID: 0}
|
|
96
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
97
|
+
type: 3}
|
|
98
|
+
propertyPath: m_LocalRotation.x
|
|
99
|
+
value: 0
|
|
100
|
+
objectReference: {fileID: 0}
|
|
101
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
102
|
+
type: 3}
|
|
103
|
+
propertyPath: m_LocalRotation.y
|
|
104
|
+
value: 0
|
|
105
|
+
objectReference: {fileID: 0}
|
|
106
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
107
|
+
type: 3}
|
|
108
|
+
propertyPath: m_LocalRotation.z
|
|
109
|
+
value: 0
|
|
110
|
+
objectReference: {fileID: 0}
|
|
111
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
112
|
+
type: 3}
|
|
113
|
+
propertyPath: m_LocalEulerAnglesHint.x
|
|
114
|
+
value: 0
|
|
115
|
+
objectReference: {fileID: 0}
|
|
116
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
117
|
+
type: 3}
|
|
118
|
+
propertyPath: m_LocalEulerAnglesHint.y
|
|
119
|
+
value: 0
|
|
120
|
+
objectReference: {fileID: 0}
|
|
121
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
122
|
+
type: 3}
|
|
123
|
+
propertyPath: m_LocalEulerAnglesHint.z
|
|
124
|
+
value: 0
|
|
125
|
+
objectReference: {fileID: 0}
|
|
126
|
+
m_RemovedComponents: []
|
|
127
|
+
m_SourcePrefab: {fileID: 100100000, guid: 60b11786261d1554799d05bae08d27e1, type: 3}
|
|
128
|
+
--- !u!4 &6152183697635635083 stripped
|
|
129
|
+
Transform:
|
|
130
|
+
m_CorrespondingSourceObject: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
131
|
+
type: 3}
|
|
132
|
+
m_PrefabInstance: {fileID: 3470307483308625010}
|
|
133
|
+
m_PrefabAsset: {fileID: 0}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: 1b6ed62193d75184fb7ffa5d4a2c75dd, type: 3}
|
|
13
|
+
m_Name: NameplateTexture
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
debug: 0
|
|
16
|
+
alwaysInvokeOnSetValue: 1
|
|
17
|
+
OnChange:
|
|
18
|
+
m_PersistentCalls:
|
|
19
|
+
m_Calls: []
|
|
20
|
+
InitialValue: {fileID: 0}
|
|
21
|
+
_value: {fileID: 0}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &7298628825334211576
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 7298628825334211577}
|
|
12
|
+
- component: {fileID: 7298628825334211462}
|
|
13
|
+
m_Layer: 0
|
|
14
|
+
m_Name: Set_Nameplate_On_Dialogue_Start
|
|
15
|
+
m_TagString: Untagged
|
|
16
|
+
m_Icon: {fileID: 0}
|
|
17
|
+
m_NavMeshLayer: 0
|
|
18
|
+
m_StaticEditorFlags: 0
|
|
19
|
+
m_IsActive: 1
|
|
20
|
+
--- !u!4 &7298628825334211577
|
|
21
|
+
Transform:
|
|
22
|
+
m_ObjectHideFlags: 0
|
|
23
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
24
|
+
m_PrefabInstance: {fileID: 0}
|
|
25
|
+
m_PrefabAsset: {fileID: 0}
|
|
26
|
+
m_GameObject: {fileID: 7298628825334211576}
|
|
27
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
28
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
30
|
+
m_ConstrainProportionsScale: 0
|
|
31
|
+
m_Children: []
|
|
32
|
+
m_Father: {fileID: 0}
|
|
33
|
+
m_RootOrder: 0
|
|
34
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
35
|
+
--- !u!114 &7298628825334211462
|
|
36
|
+
MonoBehaviour:
|
|
37
|
+
m_ObjectHideFlags: 0
|
|
38
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
39
|
+
m_PrefabInstance: {fileID: 0}
|
|
40
|
+
m_PrefabAsset: {fileID: 0}
|
|
41
|
+
m_GameObject: {fileID: 7298628825334211576}
|
|
42
|
+
m_Enabled: 1
|
|
43
|
+
m_EditorHideFlags: 0
|
|
44
|
+
m_Script: {fileID: 11500000, guid: fc792fbbb08beae43892352100e31523, type: 3}
|
|
45
|
+
m_Name:
|
|
46
|
+
m_EditorClassIdentifier:
|
|
47
|
+
nameplateHandler: {fileID: 0}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: 1b6ed62193d75184fb7ffa5d4a2c75dd, type: 3}
|
|
13
|
+
m_Name: TrialNameplateTexture
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
debug: 0
|
|
16
|
+
alwaysInvokeOnSetValue: 1
|
|
17
|
+
OnChange:
|
|
18
|
+
m_PersistentCalls:
|
|
19
|
+
m_Calls: []
|
|
20
|
+
InitialValue: {fileID: 0}
|
|
21
|
+
_value: {fileID: 0}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &443331574678599244
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 443331574678599250}
|
|
12
|
+
- component: {fileID: 443331574678599249}
|
|
13
|
+
m_Layer: 0
|
|
14
|
+
m_Name: Trial_Dialogue_Nameplate_Handler
|
|
15
|
+
m_TagString: Untagged
|
|
16
|
+
m_Icon: {fileID: 0}
|
|
17
|
+
m_NavMeshLayer: 0
|
|
18
|
+
m_StaticEditorFlags: 0
|
|
19
|
+
m_IsActive: 1
|
|
20
|
+
--- !u!4 &443331574678599250
|
|
21
|
+
Transform:
|
|
22
|
+
m_ObjectHideFlags: 0
|
|
23
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
24
|
+
m_PrefabInstance: {fileID: 0}
|
|
25
|
+
m_PrefabAsset: {fileID: 0}
|
|
26
|
+
m_GameObject: {fileID: 443331574678599244}
|
|
27
|
+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
28
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
30
|
+
m_ConstrainProportionsScale: 0
|
|
31
|
+
m_Children:
|
|
32
|
+
- {fileID: 4013300756609792924}
|
|
33
|
+
m_Father: {fileID: 0}
|
|
34
|
+
m_RootOrder: 0
|
|
35
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
36
|
+
--- !u!114 &443331574678599249
|
|
37
|
+
MonoBehaviour:
|
|
38
|
+
m_ObjectHideFlags: 0
|
|
39
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
40
|
+
m_PrefabInstance: {fileID: 0}
|
|
41
|
+
m_PrefabAsset: {fileID: 0}
|
|
42
|
+
m_GameObject: {fileID: 443331574678599244}
|
|
43
|
+
m_Enabled: 1
|
|
44
|
+
m_EditorHideFlags: 0
|
|
45
|
+
m_Script: {fileID: 11500000, guid: e63eba47d6ed772408d6f1ac79110aa3, type: 3}
|
|
46
|
+
m_Name:
|
|
47
|
+
m_EditorClassIdentifier:
|
|
48
|
+
textureEvent: {fileID: 11400000, guid: b2075d7418012b44fb19f01ea210d442, type: 2}
|
|
49
|
+
transparentImage: {fileID: 2800000, guid: efdf3526fbd9585449342947534cd679, type: 3}
|
|
50
|
+
allNameplatesTransparent: {fileID: 11400000, guid: d8ab726e6cde03241857a4c7b597b8ec,
|
|
51
|
+
type: 2}
|
|
52
|
+
setNameTransparentIfTutorial: 1
|
|
53
|
+
tutorialCharacterFirstName: Tutorial
|
|
54
|
+
--- !u!1001 &5979632386687670373
|
|
55
|
+
PrefabInstance:
|
|
56
|
+
m_ObjectHideFlags: 0
|
|
57
|
+
serializedVersion: 2
|
|
58
|
+
m_Modification:
|
|
59
|
+
m_TransformParent: {fileID: 443331574678599250}
|
|
60
|
+
m_Modifications:
|
|
61
|
+
- target: {fileID: 7298628825334211462, guid: 60b11786261d1554799d05bae08d27e1,
|
|
62
|
+
type: 3}
|
|
63
|
+
propertyPath: nameplateHandler
|
|
64
|
+
value:
|
|
65
|
+
objectReference: {fileID: 443331574678599249}
|
|
66
|
+
- target: {fileID: 7298628825334211576, guid: 60b11786261d1554799d05bae08d27e1,
|
|
67
|
+
type: 3}
|
|
68
|
+
propertyPath: m_Name
|
|
69
|
+
value: Set_Nameplate_On_Dialogue_Start
|
|
70
|
+
objectReference: {fileID: 0}
|
|
71
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
72
|
+
type: 3}
|
|
73
|
+
propertyPath: m_RootOrder
|
|
74
|
+
value: 0
|
|
75
|
+
objectReference: {fileID: 0}
|
|
76
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
77
|
+
type: 3}
|
|
78
|
+
propertyPath: m_LocalPosition.x
|
|
79
|
+
value: 0
|
|
80
|
+
objectReference: {fileID: 0}
|
|
81
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
82
|
+
type: 3}
|
|
83
|
+
propertyPath: m_LocalPosition.y
|
|
84
|
+
value: 0
|
|
85
|
+
objectReference: {fileID: 0}
|
|
86
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
87
|
+
type: 3}
|
|
88
|
+
propertyPath: m_LocalPosition.z
|
|
89
|
+
value: 0
|
|
90
|
+
objectReference: {fileID: 0}
|
|
91
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
92
|
+
type: 3}
|
|
93
|
+
propertyPath: m_LocalRotation.w
|
|
94
|
+
value: 1
|
|
95
|
+
objectReference: {fileID: 0}
|
|
96
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
97
|
+
type: 3}
|
|
98
|
+
propertyPath: m_LocalRotation.x
|
|
99
|
+
value: 0
|
|
100
|
+
objectReference: {fileID: 0}
|
|
101
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
102
|
+
type: 3}
|
|
103
|
+
propertyPath: m_LocalRotation.y
|
|
104
|
+
value: 0
|
|
105
|
+
objectReference: {fileID: 0}
|
|
106
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
107
|
+
type: 3}
|
|
108
|
+
propertyPath: m_LocalRotation.z
|
|
109
|
+
value: 0
|
|
110
|
+
objectReference: {fileID: 0}
|
|
111
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
112
|
+
type: 3}
|
|
113
|
+
propertyPath: m_LocalEulerAnglesHint.x
|
|
114
|
+
value: 0
|
|
115
|
+
objectReference: {fileID: 0}
|
|
116
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
117
|
+
type: 3}
|
|
118
|
+
propertyPath: m_LocalEulerAnglesHint.y
|
|
119
|
+
value: 0
|
|
120
|
+
objectReference: {fileID: 0}
|
|
121
|
+
- target: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
122
|
+
type: 3}
|
|
123
|
+
propertyPath: m_LocalEulerAnglesHint.z
|
|
124
|
+
value: 0
|
|
125
|
+
objectReference: {fileID: 0}
|
|
126
|
+
m_RemovedComponents: []
|
|
127
|
+
m_SourcePrefab: {fileID: 100100000, guid: 60b11786261d1554799d05bae08d27e1, type: 3}
|
|
128
|
+
--- !u!4 &4013300756609792924 stripped
|
|
129
|
+
Transform:
|
|
130
|
+
m_CorrespondingSourceObject: {fileID: 7298628825334211577, guid: 60b11786261d1554799d05bae08d27e1,
|
|
131
|
+
type: 3}
|
|
132
|
+
m_PrefabInstance: {fileID: 5979632386687670373}
|
|
133
|
+
m_PrefabAsset: {fileID: 0}
|
package/Samples.meta
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Starting;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using System.Linq;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Nameplates
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[ClassHeader("")]
|
|
14
|
+
public class SetNameplateOnDialogueStart : MonoBehaviour
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Tooltip("")]
|
|
20
|
+
[SerializeField] protected NameplateHandler nameplateHandler = null;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
protected List<IDialogueStartEvent> DialogueStartEvents = null;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
///
|
|
31
|
+
/// </summary>
|
|
32
|
+
protected virtual void Start()
|
|
33
|
+
{
|
|
34
|
+
InitializeDialogueStartEvent();
|
|
35
|
+
|
|
36
|
+
SubscribeToStartEvent();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
protected virtual void InitializeDialogueStartEvent()
|
|
43
|
+
=> DialogueStartEvents = FindObjectsByType<MonoBehaviour>().OfType<IDialogueStartEvent>().ToList();
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
///
|
|
47
|
+
/// </summary>
|
|
48
|
+
protected virtual void SubscribeToStartEvent()
|
|
49
|
+
=> DialogueStartEvents.ForEach(startEvent => startEvent.OnDialogueStarted += SetFirstSpeakersNameplate);
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/// <summary>
|
|
53
|
+
///
|
|
54
|
+
/// </summary>
|
|
55
|
+
protected virtual void OnDisable() => UnsubscribeToStartEvent();
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
protected virtual void UnsubscribeToStartEvent()
|
|
61
|
+
=> DialogueStartEvents.ForEach(startEvent => startEvent.OnDialogueStarted -= SetFirstSpeakersNameplate);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/// <summary>
|
|
65
|
+
///
|
|
66
|
+
/// </summary>
|
|
67
|
+
/// <param name="core"></param>
|
|
68
|
+
protected virtual void SetFirstSpeakersNameplate(DialogueCore core)
|
|
69
|
+
{
|
|
70
|
+
if (core is Dialogue dialogue && dialogue.Lines.Count > 0 && dialogue.Lines[0].Speaker != null)
|
|
71
|
+
nameplateHandler.SetNameplate(dialogue.Lines[0]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
|
|
4
|
+
namespace DREditor.Nameplates
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
///
|
|
8
|
+
/// </summary>
|
|
9
|
+
public class TrialDialogueNameplateHandler : DialogueNameplateHandler
|
|
10
|
+
{
|
|
11
|
+
/// <inheritdoc/>
|
|
12
|
+
public override void SetNameplate(Line currentLine)
|
|
13
|
+
{
|
|
14
|
+
if (currentLine.AliasNumber != 0)
|
|
15
|
+
SetTexture(currentLine.Speaker.Aliases[currentLine.AliasNumber - 1].TrialNameplate);
|
|
16
|
+
else if (currentLine.Speaker != null && currentLine.Speaker.TrialNameplate != null)
|
|
17
|
+
SetTexture(currentLine.Speaker.TrialNameplate);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "net.dreditor.nameplates",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "net.dreditor.nameplates",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"displayName": "DREditor Nameplates",
|
|
5
|
+
"description": "The beta for DREditor. A tool to create death game style projects without having to code.",
|
|
6
|
+
"unity": "6000.4",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"net.dreditor.core": "0.1.6"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Benjamin \"Sweden\" Jillson",
|
|
15
|
+
"email": "dreditortool@gmail.com",
|
|
16
|
+
"url": "https://dreditor.net"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"editor",
|
|
20
|
+
"tool",
|
|
21
|
+
"dreditor"
|
|
22
|
+
],
|
|
23
|
+
"samples": [
|
|
24
|
+
{
|
|
25
|
+
"displayName": "Samples",
|
|
26
|
+
"description": "",
|
|
27
|
+
"path": "Samples~"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"documentationUrl": "https://dreditor.net",
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"licensesUrl": "https://dreditor.net/docs/LICENSE.html",
|
|
33
|
+
"changelogUrl": "https://dreditor.net/docs/CHANGELOG.html"
|
|
34
|
+
}
|
package/README.md
DELETED