fr.jeanf.eventsystem 0.1.71 → 0.1.73

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 (25) hide show
  1. package/Runtime/Listeners/IntBoolEventListener.cs +49 -0
  2. package/Runtime/Listeners/IntBoolEventListener.cs.meta +11 -0
  3. package/Runtime/Listeners/IntFloatEventListener.cs +49 -0
  4. package/Runtime/Listeners/IntFloatEventListener.cs.meta +11 -0
  5. package/Runtime/Listeners/IntIntEventListener.cs +49 -0
  6. package/Runtime/Listeners/IntIntEventListener.cs.meta +11 -0
  7. package/Runtime/Listeners/IntStringEventListener.cs +49 -0
  8. package/Runtime/Listeners/IntStringEventListener.cs.meta +11 -0
  9. package/Runtime/ScriptableObjects/IntBoolEventChannelSO.cs +17 -0
  10. package/Runtime/ScriptableObjects/IntBoolEventChannelSO.cs.meta +11 -0
  11. package/Runtime/ScriptableObjects/IntFloatEventChannelSO.cs +17 -0
  12. package/Runtime/ScriptableObjects/IntFloatEventChannelSO.cs.meta +11 -0
  13. package/Runtime/ScriptableObjects/IntIntEventChannelSO.cs +17 -0
  14. package/Runtime/ScriptableObjects/IntIntEventChannelSO.cs.meta +11 -0
  15. package/Runtime/ScriptableObjects/IntStringEventChannelSO.cs +17 -0
  16. package/Runtime/ScriptableObjects/IntStringEventChannelSO.cs.meta +11 -0
  17. package/Runtime/SenderInterfaces/IntBoolEventSender.cs +22 -0
  18. package/Runtime/SenderInterfaces/IntBoolEventSender.cs.meta +11 -0
  19. package/Runtime/SenderInterfaces/IntFloatEventSender.cs +22 -0
  20. package/Runtime/SenderInterfaces/IntFloatEventSender.cs.meta +11 -0
  21. package/Runtime/SenderInterfaces/IntIntEventSender.cs +22 -0
  22. package/Runtime/SenderInterfaces/IntIntEventSender.cs.meta +11 -0
  23. package/Runtime/SenderInterfaces/IntStringEventSender.cs +22 -0
  24. package/Runtime/SenderInterfaces/IntStringEventSender.cs.meta +11 -0
  25. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ /// <summary>
5
+ /// To use a generic UnityEvent type you must override the generic type.
6
+ /// </summary>
7
+ namespace jeanf.EventSystem
8
+ {
9
+ [System.Serializable]
10
+ public class IntBoolEvent : UnityEvent<int, bool>
11
+ {
12
+
13
+ }
14
+
15
+ /// <summary>
16
+ /// A flexible handler for int events in the form of a MonoBehaviour. Responses can be connected directly from the Unity Inspector.
17
+ /// </summary>
18
+ public class IntBoolEventListener : MonoBehaviour, IDebugBehaviour
19
+ {
20
+ public bool isDebug
21
+ {
22
+ get => _isDebug;
23
+ set => _isDebug = value;
24
+ }
25
+ [SerializeField] private bool _isDebug = false;
26
+
27
+ [SerializeField] private IntBoolEventChannelSO _channel = default;
28
+
29
+ public IntBoolEvent OnEventRaised;
30
+
31
+ private void OnEnable()
32
+ {
33
+ if (_channel != null)
34
+ _channel.OnEventRaised += Respond;
35
+ }
36
+
37
+ private void OnDisable()
38
+ {
39
+ if (_channel != null)
40
+ _channel.OnEventRaised -= Respond;
41
+ }
42
+
43
+ private void Respond(int nb, bool value)
44
+ {
45
+ OnEventRaised?.Invoke(nb, value);
46
+ if(isDebug) Debug.Log($" int-bool event raised: <{nb},{value}>");
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: b31fc1ea1a9cc324ab4442147d08baa8
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,49 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ /// <summary>
5
+ /// To use a generic UnityEvent type you must override the generic type.
6
+ /// </summary>
7
+ namespace jeanf.EventSystem
8
+ {
9
+ [System.Serializable]
10
+ public class IntFloatEvent : UnityEvent<int, float>
11
+ {
12
+
13
+ }
14
+
15
+ /// <summary>
16
+ /// A flexible handler for int events in the form of a MonoBehaviour. Responses can be connected directly from the Unity Inspector.
17
+ /// </summary>
18
+ public class IntFloatEventListener : MonoBehaviour, IDebugBehaviour
19
+ {
20
+ public bool isDebug
21
+ {
22
+ get => _isDebug;
23
+ set => _isDebug = value;
24
+ }
25
+ [SerializeField] private bool _isDebug = false;
26
+
27
+ [SerializeField] private IntFloatEventChannelSO _channel = default;
28
+
29
+ public IntFloatEvent OnEventRaised;
30
+
31
+ private void OnEnable()
32
+ {
33
+ if (_channel != null)
34
+ _channel.OnEventRaised += Respond;
35
+ }
36
+
37
+ private void OnDisable()
38
+ {
39
+ if (_channel != null)
40
+ _channel.OnEventRaised -= Respond;
41
+ }
42
+
43
+ private void Respond(int nb, float value)
44
+ {
45
+ OnEventRaised?.Invoke(nb, value);
46
+ if(isDebug) Debug.Log($" int-bool event raised: <{nb},{value}>");
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 2f9c6e0899cd67c4d9411409ec767aa8
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,49 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ /// <summary>
5
+ /// To use a generic UnityEvent type you must override the generic type.
6
+ /// </summary>
7
+ namespace jeanf.EventSystem
8
+ {
9
+ [System.Serializable]
10
+ public class IntIntEvent : UnityEvent<int, int>
11
+ {
12
+
13
+ }
14
+
15
+ /// <summary>
16
+ /// A flexible handler for int events in the form of a MonoBehaviour. Responses can be connected directly from the Unity Inspector.
17
+ /// </summary>
18
+ public class IntIntEventListener : MonoBehaviour, IDebugBehaviour
19
+ {
20
+ public bool isDebug
21
+ {
22
+ get => _isDebug;
23
+ set => _isDebug = value;
24
+ }
25
+ [SerializeField] private bool _isDebug = false;
26
+
27
+ [SerializeField] private IntIntEventChannelSO _channel = default;
28
+
29
+ public IntIntEvent OnEventRaised;
30
+
31
+ private void OnEnable()
32
+ {
33
+ if (_channel != null)
34
+ _channel.OnEventRaised += Respond;
35
+ }
36
+
37
+ private void OnDisable()
38
+ {
39
+ if (_channel != null)
40
+ _channel.OnEventRaised -= Respond;
41
+ }
42
+
43
+ private void Respond(int nb, int value)
44
+ {
45
+ OnEventRaised?.Invoke(nb, value);
46
+ if(isDebug) Debug.Log($" int-bool event raised: <{nb},{value}>");
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 26890c503e4c4784183e69adddc22e30
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,49 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ /// <summary>
5
+ /// To use a generic UnityEvent type you must override the generic type.
6
+ /// </summary>
7
+ namespace jeanf.EventSystem
8
+ {
9
+ [System.Serializable]
10
+ public class IntStringEvent : UnityEvent<int, string>
11
+ {
12
+
13
+ }
14
+
15
+ /// <summary>
16
+ /// A flexible handler for int events in the form of a MonoBehaviour. Responses can be connected directly from the Unity Inspector.
17
+ /// </summary>
18
+ public class IntStringEventListener : MonoBehaviour, IDebugBehaviour
19
+ {
20
+ public bool isDebug
21
+ {
22
+ get => _isDebug;
23
+ set => _isDebug = value;
24
+ }
25
+ [SerializeField] private bool _isDebug = false;
26
+
27
+ [SerializeField] private IntStringEventChannelSO _channel = default;
28
+
29
+ public IntStringEvent OnEventRaised;
30
+
31
+ private void OnEnable()
32
+ {
33
+ if (_channel != null)
34
+ _channel.OnEventRaised += Respond;
35
+ }
36
+
37
+ private void OnDisable()
38
+ {
39
+ if (_channel != null)
40
+ _channel.OnEventRaised -= Respond;
41
+ }
42
+
43
+ private void Respond(int nb, string value)
44
+ {
45
+ OnEventRaised?.Invoke(nb, value);
46
+ if(isDebug) Debug.Log($" int-bool event raised: <{nb},{value}>");
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 8f1e42bef167b3d47a669d60135f8b20
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ namespace jeanf.EventSystem
5
+ {
6
+ [CreateAssetMenu(menuName = "Events/<Int,Bool> Event Channel")]
7
+
8
+ public class IntBoolEventChannelSO : DescriptionBaseSO
9
+ {
10
+ public UnityAction<int, bool> OnEventRaised;
11
+
12
+ public void RaiseEvent(int nb, bool value)
13
+ {
14
+ OnEventRaised?.Invoke(nb, value);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c517dcaff6aba9647abda83ef70a575e
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ namespace jeanf.EventSystem
5
+ {
6
+ [CreateAssetMenu(menuName = "Events/<Int,Float> Event Channel")]
7
+
8
+ public class IntFloatEventChannelSO : DescriptionBaseSO
9
+ {
10
+ public UnityAction<int, float> OnEventRaised;
11
+
12
+ public void RaiseEvent(int nb, float value)
13
+ {
14
+ OnEventRaised?.Invoke(nb, value);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: e6140d0be03101b4487df521d3512291
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ namespace jeanf.EventSystem
5
+ {
6
+ [CreateAssetMenu(menuName = "Events/<Int,Int> Event Channel")]
7
+
8
+ public class IntIntEventChannelSO : DescriptionBaseSO
9
+ {
10
+ public UnityAction<int, int> OnEventRaised;
11
+
12
+ public void RaiseEvent(int nb, int value)
13
+ {
14
+ OnEventRaised?.Invoke(nb, value);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c25e514eb39ec1e499ae1a7b04ef01e3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ using UnityEngine;
2
+ using UnityEngine.Events;
3
+
4
+ namespace jeanf.EventSystem
5
+ {
6
+ [CreateAssetMenu(menuName = "Events/<Int,String> Event Channel")]
7
+
8
+ public class IntStringEventChannelSO : DescriptionBaseSO
9
+ {
10
+ public UnityAction<int, string> OnEventRaised;
11
+
12
+ public void RaiseEvent(int nb, string value)
13
+ {
14
+ OnEventRaised?.Invoke(nb, value);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 44a9394df7c0ac64a859685414d06dd7
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,22 @@
1
+ using UnityEngine;
2
+
3
+ namespace jeanf.EventSystem
4
+ {
5
+ public class IntBoolEventSender : MonoBehaviour, IDebugBehaviour
6
+ {
7
+ public bool isDebug
8
+ {
9
+ get => _isDebug;
10
+ set => _isDebug = value;
11
+ }
12
+ [SerializeField] private bool _isDebug = false;
13
+
14
+ [field: Header("Broadcasting on:")] public IntBoolEventChannelSO boolMessageChannel;
15
+
16
+ public void SendIntBool(int nb, bool value)
17
+ {
18
+ boolMessageChannel.RaiseEvent(nb, value);
19
+ }
20
+ }
21
+ }
22
+
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 08baf5cb7fec3ac4dbfe52ffdcae331c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,22 @@
1
+ using UnityEngine;
2
+
3
+ namespace jeanf.EventSystem
4
+ {
5
+ public class IntFloatEventSender : MonoBehaviour, IDebugBehaviour
6
+ {
7
+ public bool isDebug
8
+ {
9
+ get => _isDebug;
10
+ set => _isDebug = value;
11
+ }
12
+ [SerializeField] private bool _isDebug = false;
13
+
14
+ [field: Header("Broadcasting on:")] public IntFloatEventChannelSO intfloatMessageChannel;
15
+
16
+ public void SendIntFloat(int nb, float value)
17
+ {
18
+ intfloatMessageChannel.RaiseEvent(nb, value);
19
+ }
20
+ }
21
+ }
22
+
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4d8d7f2ce7ba16640982732bc6c76f9d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,22 @@
1
+ using UnityEngine;
2
+
3
+ namespace jeanf.EventSystem
4
+ {
5
+ public class IntIntEventSender : MonoBehaviour, IDebugBehaviour
6
+ {
7
+ public bool isDebug
8
+ {
9
+ get => _isDebug;
10
+ set => _isDebug = value;
11
+ }
12
+ [SerializeField] private bool _isDebug = false;
13
+
14
+ [field: Header("Broadcasting on:")] public IntIntEventChannelSO intintMessageChannel;
15
+
16
+ public void SendIntInt(int nb, int value)
17
+ {
18
+ intintMessageChannel.RaiseEvent(nb, value);
19
+ }
20
+ }
21
+ }
22
+
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: f4782105f5761ca4cbf1b35b8e5ff735
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,22 @@
1
+ using UnityEngine;
2
+
3
+ namespace jeanf.EventSystem
4
+ {
5
+ public class IntStringEventSender : MonoBehaviour, IDebugBehaviour
6
+ {
7
+ public bool isDebug
8
+ {
9
+ get => _isDebug;
10
+ set => _isDebug = value;
11
+ }
12
+ [SerializeField] private bool _isDebug = false;
13
+
14
+ [field: Header("Broadcasting on:")] public IntStringEventChannelSO intintMessageChannel;
15
+
16
+ public void SendIntString(int nb, string value)
17
+ {
18
+ intintMessageChannel.RaiseEvent(nb, value);
19
+ }
20
+ }
21
+ }
22
+
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4785229d2ecf12e43b829885d40df1a4
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,6 +1,6 @@
1
1
  {
2
2
  "name":"fr.jeanf.eventsystem",
3
- "version":"0.1.71",
3
+ "version":"0.1.73",
4
4
  "displayName":"Event System",
5
5
  "description":"This package contains a basic Event System based on Scriptable Objects as communication medium",
6
6
  "unity": "2021.3",