net.dreditor.subareas 0.1.6 → 0.1.8

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.
@@ -1,110 +1,110 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using DREditor.Dialogues.Finishing;
4
- using DREditor.EventObjects;
5
- using DREditor.LocalDialogues;
6
- using DREditor.Services;
7
- using System;
8
- using System.Collections.Generic;
9
- using System.Linq;
10
- using UnityEngine;
11
-
12
- namespace DREditor.SubAreas
13
- {
14
- /// <summary>
15
- ///
16
- /// </summary>
17
- public abstract class SubAreaManagerBase : MonoBehaviour
18
- {
19
- /// <summary>
20
- ///
21
- /// </summary>
22
- [Header("")]
23
- [Divider]
24
- [Tooltip("")]
25
- [SerializeField] protected StringWithEvent currentDisplayName = null;
26
-
27
- /// <summary>
28
- ///
29
- /// </summary>
30
- [Tooltip("")]
31
- [SerializeField] protected BoolWithEvent inDialogue = null;
32
-
33
- /// <summary>
34
- ///
35
- /// </summary>
36
- [Tooltip("")]
37
- [SerializeField] protected BoolWithEvent inTPFD = null;
38
-
39
-
40
- /// <summary>
41
- ///
42
- /// </summary>
43
- protected IDialogueManager dialogueManager;
44
-
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- protected virtual void Awake()
50
- {
51
- if (ServiceLocator.HasService<IDialogueManager>())
52
- dialogueManager = ServiceLocator.GetService<IDialogueManager>();
53
- }
54
-
55
- /// <summary>
56
- ///
57
- /// </summary>
58
- /// <param name="selectableObject"></param>
59
- /// <param name="dialogues"></param>
60
- /// <returns></returns>
61
- protected virtual bool TryPlayingDialogue(SelectableObject selectableObject, List<LocalDialogue> dialogues)
62
- {
63
- Dialogue dialogue = ServiceLocator.GetService<LocalDialogueHandlerBase>().EvaluateDialogue(dialogues);
64
-
65
- bool result = dialogue != null;
66
-
67
- if (result)
68
- dialogueManager.StartDialogue(selectableObject, dialogue);
69
- else
70
- UnityEngine.Debug.LogWarning($"ALERT: Sub Area {gameObject.name} failed to play valid dialogue!");
71
-
72
- return result;
73
- }
74
-
75
- /// <summary>
76
- ///
77
- /// </summary>
78
- /// <param name="action"></param>
79
- protected virtual void SubscribeEndDialogueEvent(Action action)
80
- {
81
- var endEvents = FindObjectsByType<MonoBehaviour>().OfType<IEndDialogueEvent>();
82
-
83
- foreach(var endEvent in endEvents)
84
- endEvent.OnDialogueEnd += action;
85
- }
86
-
87
- /// <summary>
88
- ///
89
- /// </summary>
90
- /// <param name="action"></param>
91
- protected virtual void UnsubscribeEndDialogueEvent(Action action)
92
- {
93
- var endEvents = FindObjectsByType<MonoBehaviour>().OfType<IEndDialogueEvent>();
94
-
95
- foreach (var endEvent in endEvents)
96
- endEvent.OnDialogueEnd -= action;
97
- }
98
-
99
- /// <summary>
100
- ///
101
- /// </summary>
102
- protected virtual void TurnOffDisplayedObjectName()
103
- {
104
- if (currentDisplayName.Value == "")
105
- currentDisplayName.Invoke();
106
- else
107
- currentDisplayName.SetValue("");
108
- }
109
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.Finishing;
4
+ using DREditor.EventObjects;
5
+ using DREditor.LocalDialogues;
6
+ using DREditor.Services;
7
+ using System;
8
+ using System.Collections.Generic;
9
+ using System.Linq;
10
+ using UnityEngine;
11
+
12
+ namespace DREditor.SubAreas
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ public abstract class SubAreaManagerBase : MonoBehaviour
18
+ {
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ [Header("")]
23
+ [Divider]
24
+ [Tooltip("")]
25
+ [SerializeField] protected StringWithEvent currentDisplayName = null;
26
+
27
+ /// <summary>
28
+ ///
29
+ /// </summary>
30
+ [Tooltip("")]
31
+ [SerializeField] protected BoolWithEvent inDialogue = null;
32
+
33
+ /// <summary>
34
+ ///
35
+ /// </summary>
36
+ [Tooltip("")]
37
+ [SerializeField] protected BoolWithEvent inTPFD = null;
38
+
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ protected IDialogueManager dialogueManager;
44
+
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ protected virtual void Awake()
50
+ {
51
+ if (ServiceLocator.HasService<IDialogueManager>())
52
+ dialogueManager = ServiceLocator.GetService<IDialogueManager>();
53
+ }
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ /// <param name="selectableObject"></param>
59
+ /// <param name="dialogues"></param>
60
+ /// <returns></returns>
61
+ protected virtual bool TryPlayingDialogue(SelectableObject selectableObject, List<LocalDialogue> dialogues)
62
+ {
63
+ Dialogue dialogue = ServiceLocator.GetService<LocalDialogueHandlerBase>().EvaluateDialogue(dialogues);
64
+
65
+ bool result = dialogue != null;
66
+
67
+ if (result)
68
+ dialogueManager.StartDialogue(selectableObject, dialogue);
69
+ else
70
+ UnityEngine.Debug.LogWarning($"ALERT: Sub Area {gameObject.name} failed to play valid dialogue!");
71
+
72
+ return result;
73
+ }
74
+
75
+ /// <summary>
76
+ ///
77
+ /// </summary>
78
+ /// <param name="action"></param>
79
+ protected virtual void SubscribeEndDialogueEvent(Action action)
80
+ {
81
+ var endEvents = FindObjectsByType<MonoBehaviour>().OfType<IEndDialogueEvent>();
82
+
83
+ foreach(var endEvent in endEvents)
84
+ endEvent.OnDialogueEnd += action;
85
+ }
86
+
87
+ /// <summary>
88
+ ///
89
+ /// </summary>
90
+ /// <param name="action"></param>
91
+ protected virtual void UnsubscribeEndDialogueEvent(Action action)
92
+ {
93
+ var endEvents = FindObjectsByType<MonoBehaviour>().OfType<IEndDialogueEvent>();
94
+
95
+ foreach (var endEvent in endEvents)
96
+ endEvent.OnDialogueEnd -= action;
97
+ }
98
+
99
+ /// <summary>
100
+ ///
101
+ /// </summary>
102
+ protected virtual void TurnOffDisplayedObjectName()
103
+ {
104
+ if (currentDisplayName.Value == "")
105
+ currentDisplayName.Invoke();
106
+ else
107
+ currentDisplayName.SetValue("");
108
+ }
109
+ }
110
110
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 05fec30b829a9dd4194f36c89561a9d2
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: 05fec30b829a9dd4194f36c89561a9d2
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/package.json CHANGED
@@ -1,41 +1,46 @@
1
- {
2
- "name": "net.dreditor.subareas",
3
- "version": "0.1.6",
4
- "displayName": "DREditor Sub Areas",
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
- "com.unity.inputsystem": "1.19.0",
9
- "net.dreditor.core": "0.1.6",
10
- "net.dreditor.input": "0.1.6",
11
- "net.dreditor.fading": "0.1.6",
12
- "net.dreditor.localdialogues": "0.1.6",
13
- "net.dreditor.choices": "0.1.6",
14
- "net.dreditor.twopointfived": "0.1.6",
15
- "net.dreditor.doors": "0.1.6"
16
- },
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "author": {
21
- "name": "Benjamin \"Sweden\" Jillson",
22
- "email": "dreditortool@gmail.com",
23
- "url": "https://dreditor.net"
24
- },
25
- "keywords": [
26
- "editor",
27
- "tool",
28
- "dreditor"
29
- ],
30
- "samples": [
31
- {
32
- "displayName": "Samples",
33
- "description": "",
34
- "path": "Samples~"
35
- }
36
- ],
37
- "documentationUrl": "https://dreditor.net",
38
- "license": "Apache-2.0",
39
- "licensesUrl": "https://dreditor.net/docs/LICENSE.html",
40
- "changelogUrl": "https://dreditor.net/docs/CHANGELOG.html"
41
- }
1
+ {
2
+ "name": "net.dreditor.subareas",
3
+ "version": "0.1.8",
4
+ "displayName": "DREditor Sub Areas",
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
+ "com.unity.inputsystem": "1.19.0",
9
+ "net.dreditor.core": "0.1.8",
10
+ "net.dreditor.input": "0.1.8",
11
+ "net.dreditor.fading": "0.1.8",
12
+ "net.dreditor.localdialogues": "0.1.8",
13
+ "net.dreditor.choices": "0.1.8",
14
+ "net.dreditor.twopointfived": "0.1.8",
15
+ "net.dreditor.doors": "0.1.8"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "author": {
21
+ "name": "Benjamin \"Sweden\" Jillson",
22
+ "email": "dreditortool@gmail.com",
23
+ "url": "https://dreditor.net"
24
+ },
25
+ "keywords": [
26
+ "editor",
27
+ "tool",
28
+ "dreditor"
29
+ ],
30
+ "samples": [
31
+ {
32
+ "displayName": "Samples",
33
+ "description": "",
34
+ "path": "Samples~"
35
+ }
36
+ ],
37
+ "documentationUrl": "https://dreditor.net",
38
+ "license": "Apache-2.0",
39
+ "licensesUrl": "https://dreditor.net/docs/LICENSE.html",
40
+ "changelogUrl": "https://dreditor.net/docs/CHANGELOG.html",
41
+ "repository": {
42
+ "url": "https://github.com/CertifiedSharp/DREditor",
43
+ "type": "git",
44
+ "revision": "416b18f937fb917bf3f595362a1082ed97457744"
45
+ }
46
+ }
package/package.json.meta CHANGED
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 1605a823a31197b4aa0411bed63cb936
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 1605a823a31197b4aa0411bed63cb936
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Samples.meta DELETED
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: d571b402ad5296d43ba469972a0ec418
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant: