fr.jeanf.eventsystem 0.1.72 → 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.
@@ -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,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:
@@ -13,7 +13,7 @@ namespace jeanf.EventSystem
13
13
 
14
14
  [field: Header("Broadcasting on:")] public IntBoolEventChannelSO boolMessageChannel;
15
15
 
16
- public void SendBool(int nb, bool value)
16
+ public void SendIntBool(int nb, bool value)
17
17
  {
18
18
  boolMessageChannel.RaiseEvent(nb, value);
19
19
  }
@@ -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.72",
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",