net.dreditor.nameplates 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 (32) hide show
  1. package/.attestation.p7m +0 -0
  2. package/DREditor.Nameplates.asmdef +15 -15
  3. package/DREditor.Nameplates.asmdef.meta +7 -7
  4. package/DialogueNameplateHandler.cs +80 -80
  5. package/DialogueNameplateHandler.cs.meta +11 -11
  6. package/ITransparentableNameplate.cs +14 -14
  7. package/ITransparentableNameplate.cs.meta +11 -11
  8. package/NameplateHandler.cs +76 -76
  9. package/NameplateHandler.cs.meta +11 -11
  10. package/{Samples → Samples~}/AllNameplatesTransparent.asset +14 -14
  11. package/{Samples → Samples~}/AllNameplatesTransparent.asset.meta +8 -8
  12. package/{Samples → Samples~}/CGNameplateTexture.asset +21 -21
  13. package/{Samples → Samples~}/CGNameplateTexture.asset.meta +8 -8
  14. package/{Samples → Samples~}/CG_Nameplate_Handler.prefab +57 -57
  15. package/{Samples → Samples~}/CG_Nameplate_Handler.prefab.meta +7 -7
  16. package/{Samples → Samples~}/Dialogue_Nameplate_Handler.prefab +133 -133
  17. package/{Samples → Samples~}/Dialogue_Nameplate_Handler.prefab.meta +7 -7
  18. package/{Samples → Samples~}/NameplateTexture.asset +21 -21
  19. package/{Samples → Samples~}/NameplateTexture.asset.meta +8 -8
  20. package/{Samples → Samples~}/Set_Nameplate_On_Dialogue_Start.prefab +47 -47
  21. package/{Samples → Samples~}/Set_Nameplate_On_Dialogue_Start.prefab.meta +7 -7
  22. package/{Samples → Samples~}/TrialNameplateTexture.asset +21 -21
  23. package/{Samples → Samples~}/TrialNameplateTexture.asset.meta +8 -8
  24. package/{Samples → Samples~}/Trial_Dialogue_Nameplate_Handler.prefab +133 -133
  25. package/{Samples → Samples~}/Trial_Dialogue_Nameplate_Handler.prefab.meta +7 -7
  26. package/SetNameplateOnDialogueStart.cs +73 -73
  27. package/SetNameplateOnDialogueStart.cs.meta +11 -11
  28. package/TrialDialogueNameplateHandler.cs +19 -19
  29. package/TrialDialogueNameplateHandler.cs.meta +11 -11
  30. package/package.json +39 -34
  31. package/package.json.meta +7 -7
  32. package/Samples.meta +0 -8
Binary file
@@ -1,16 +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
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
16
  }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: bfb209c5c995c794cad335c4cee0f814
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: bfb209c5c995c794cad335c4cee0f814
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,81 +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
- }
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
81
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: be61f8bf585533e4cbfa5a0473678d1f
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: be61f8bf585533e4cbfa5a0473678d1f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,15 +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
- }
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
15
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 6414a7ba22f016d499403cb183564fc3
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: 6414a7ba22f016d499403cb183564fc3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,77 +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
- }
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
77
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: a0cc96f724453824f97015b7dd11fc4c
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: a0cc96f724453824f97015b7dd11fc4c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,14 +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:
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:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: d8ab726e6cde03241857a4c7b597b8ec
3
- NativeFormatImporter:
4
- externalObjects: {}
5
- mainObjectFileID: 11400000
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: d8ab726e6cde03241857a4c7b597b8ec
3
+ NativeFormatImporter:
4
+ externalObjects: {}
5
+ mainObjectFileID: 11400000
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,21 +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}
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}
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: ec7708d2ca7ca7e4b88afeda9156bb70
3
- NativeFormatImporter:
4
- externalObjects: {}
5
- mainObjectFileID: 11400000
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: ec7708d2ca7ca7e4b88afeda9156bb70
3
+ NativeFormatImporter:
4
+ externalObjects: {}
5
+ mainObjectFileID: 11400000
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant: