fr.jeanf.eventsystem 0.1.91 → 0.1.92
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/Runtime/Listeners/Advanced/DecimalGameObjectEventListener.cs +49 -0
- package/Runtime/Listeners/Advanced/DecimalGameObjectEventListener.cs.meta +11 -0
- package/Runtime/Listeners/Advanced.meta +8 -0
- package/Runtime/ScriptableObjects/Advanced/DecimalGameObjectEventChannelSO.cs +17 -0
- package/Runtime/ScriptableObjects/Advanced/DecimalGameObjectEventChannelSO.cs.meta +11 -0
- package/Runtime/SenderInterfaces/Advanced/DecimalGameObjectEventSender.cs +21 -0
- package/Runtime/SenderInterfaces/Advanced/DecimalGameObjectEventSender.cs.meta +11 -0
- package/Runtime/SenderInterfaces/Advanced.meta +8 -0
- package/package.json +1 -1
- /package/Runtime/Listeners/{IntBoolEventListener.cs → Advanced/IntBoolEventListener.cs} +0 -0
- /package/Runtime/Listeners/{IntBoolEventListener.cs.meta → Advanced/IntBoolEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{IntFloatEventListener.cs → Advanced/IntFloatEventListener.cs} +0 -0
- /package/Runtime/Listeners/{IntFloatEventListener.cs.meta → Advanced/IntFloatEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{IntGameObjectEventListener.cs → Advanced/IntGameObjectEventListener.cs} +0 -0
- /package/Runtime/Listeners/{IntGameObjectEventListener.cs.meta → Advanced/IntGameObjectEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{IntIntEventListener.cs → Advanced/IntIntEventListener.cs} +0 -0
- /package/Runtime/Listeners/{IntIntEventListener.cs.meta → Advanced/IntIntEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{IntStringEventListener.cs → Advanced/IntStringEventListener.cs} +0 -0
- /package/Runtime/Listeners/{IntStringEventListener.cs.meta → Advanced/IntStringEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{StringBoolEventListener.cs → Advanced/StringBoolEventListener.cs} +0 -0
- /package/Runtime/Listeners/{StringBoolEventListener.cs.meta → Advanced/StringBoolEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{StringFloatEventListener.cs → Advanced/StringFloatEventListener.cs} +0 -0
- /package/Runtime/Listeners/{StringFloatEventListener.cs.meta → Advanced/StringFloatEventListener.cs.meta} +0 -0
- /package/Runtime/Listeners/{StringStringEventListener.cs → Advanced/StringStringEventListener.cs} +0 -0
- /package/Runtime/Listeners/{StringStringEventListener.cs.meta → Advanced/StringStringEventListener.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{IntBoolEventSender.cs → Advanced/IntBoolEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{IntBoolEventSender.cs.meta → Advanced/IntBoolEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{IntFloatEventSender.cs → Advanced/IntFloatEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{IntFloatEventSender.cs.meta → Advanced/IntFloatEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{IntGameObjectEventSender.cs → Advanced/IntGameObjectEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{IntGameObjectEventSender.cs.meta → Advanced/IntGameObjectEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{IntIntEventSender.cs → Advanced/IntIntEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{IntIntEventSender.cs.meta → Advanced/IntIntEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{IntStringEventSender.cs → Advanced/IntStringEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{IntStringEventSender.cs.meta → Advanced/IntStringEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{StringBoolEventSender.cs → Advanced/StringBoolEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{StringBoolEventSender.cs.meta → Advanced/StringBoolEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{StringFloatEventSender.cs → Advanced/StringFloatEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{StringFloatEventSender.cs.meta → Advanced/StringFloatEventSender.cs.meta} +0 -0
- /package/Runtime/SenderInterfaces/{StringStringEventSender.cs → Advanced/StringStringEventSender.cs} +0 -0
- /package/Runtime/SenderInterfaces/{StringStringEventSender.cs.meta → Advanced/StringStringEventSender.cs.meta} +0 -0
|
@@ -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 DecimalGameObjectEvent : UnityEvent<decimal, GameObject>
|
|
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 DecimalGameObjectEventListener : 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 DecimalGameObjectEventChannelSO _channel = default;
|
|
28
|
+
|
|
29
|
+
public DecimalGameObjectEvent 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(decimal nb, GameObject value)
|
|
44
|
+
{
|
|
45
|
+
OnEventRaised?.Invoke(nb, value);
|
|
46
|
+
if(isDebug) Debug.Log($" decimal-gameObject event raised: <{nb},{value}>");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using UnityEngine.Events;
|
|
3
|
+
|
|
4
|
+
namespace jeanf.EventSystem
|
|
5
|
+
{
|
|
6
|
+
[CreateAssetMenu(menuName = "Events/Advanced/<Decimal,GameObject> Event Channel")]
|
|
7
|
+
|
|
8
|
+
public class DecimalGameObjectEventChannelSO : DescriptionBaseSO
|
|
9
|
+
{
|
|
10
|
+
public UnityAction<decimal, GameObject> OnEventRaised;
|
|
11
|
+
|
|
12
|
+
public void RaiseEvent(decimal nb, GameObject value)
|
|
13
|
+
{
|
|
14
|
+
OnEventRaised?.Invoke(nb, value);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
namespace jeanf.EventSystem
|
|
4
|
+
{
|
|
5
|
+
public class DecimalGameObjectEventSender : 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 DecimalGameObjectEventChannelSO gameObjectMessageChannel;
|
|
15
|
+
|
|
16
|
+
public void SendIntBool(decimal nb, GameObject value)
|
|
17
|
+
{
|
|
18
|
+
gameObjectMessageChannel.RaiseEvent(nb, value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
File without changes
|
/package/Runtime/Listeners/{IntBoolEventListener.cs.meta → Advanced/IntBoolEventListener.cs.meta}
RENAMED
|
File without changes
|
|
File without changes
|
/package/Runtime/Listeners/{IntFloatEventListener.cs.meta → Advanced/IntFloatEventListener.cs.meta}
RENAMED
|
File without changes
|
/package/Runtime/Listeners/{IntGameObjectEventListener.cs → Advanced/IntGameObjectEventListener.cs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Runtime/Listeners/{IntIntEventListener.cs.meta → Advanced/IntIntEventListener.cs.meta}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Runtime/Listeners/{StringBoolEventListener.cs → Advanced/StringBoolEventListener.cs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/Runtime/Listeners/{StringFloatEventListener.cs → Advanced/StringFloatEventListener.cs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/Runtime/Listeners/{StringStringEventListener.cs → Advanced/StringStringEventListener.cs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Runtime/SenderInterfaces/{IntBoolEventSender.cs.meta → Advanced/IntBoolEventSender.cs.meta}
RENAMED
|
File without changes
|
/package/Runtime/SenderInterfaces/{IntFloatEventSender.cs → Advanced/IntFloatEventSender.cs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/Runtime/SenderInterfaces/{IntIntEventSender.cs.meta → Advanced/IntIntEventSender.cs.meta}
RENAMED
|
File without changes
|
/package/Runtime/SenderInterfaces/{IntStringEventSender.cs → Advanced/IntStringEventSender.cs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/Runtime/SenderInterfaces/{StringBoolEventSender.cs → Advanced/StringBoolEventSender.cs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/Runtime/SenderInterfaces/{StringFloatEventSender.cs → Advanced/StringFloatEventSender.cs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/Runtime/SenderInterfaces/{StringStringEventSender.cs → Advanced/StringStringEventSender.cs}
RENAMED
|
File without changes
|
|
File without changes
|