fr.jeanf.eventsystem 0.1.2 → 0.1.4
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/BaseClasses/TeleportInformation.cs +0 -10
- package/Runtime/Listeners/BoolEventListener.cs +9 -1
- package/Runtime/Listeners/VoidEventListener.cs +2 -2
- package/Runtime/SenderInterfaces/BoolEventSender.cs +19 -0
- package/Runtime/SenderInterfaces/BoolEventSender.cs.meta +11 -0
- package/Samples/PlayerChannels/GloveState Event Channel SO.asset +16 -0
- package/Samples/PlayerChannels/GloveState Event Channel SO.asset.meta +8 -0
- package/package.json +1 -1
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
using System.Collections;
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using UnityEditor.TextCore.Text;
|
|
4
1
|
using UnityEngine;
|
|
5
2
|
|
|
6
3
|
namespace jeanf.EventSystem
|
|
@@ -12,13 +9,6 @@ namespace jeanf.EventSystem
|
|
|
12
9
|
public Transform targetDestination;
|
|
13
10
|
public bool isUsingFilter;
|
|
14
11
|
public FilterSO filter;
|
|
15
|
-
|
|
16
|
-
public TeleportInformation(Transform targetDestination, bool alignToTarget)
|
|
17
|
-
{
|
|
18
|
-
this.targetDestination = targetDestination;
|
|
19
|
-
this.objectIsPlayer = true;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
12
|
public TeleportInformation(Transform objectToTeleport, Transform targetDestination, bool objectIsPlayer, FilterSO filter, bool isUsingFilter)
|
|
23
13
|
{
|
|
24
14
|
this.objectToTeleport = objectToTeleport;
|
|
@@ -15,8 +15,15 @@ namespace jeanf.EventSystem
|
|
|
15
15
|
/// <summary>
|
|
16
16
|
/// A flexible handler for int events in the form of a MonoBehaviour. Responses can be connected directly from the Unity Inspector.
|
|
17
17
|
/// </summary>
|
|
18
|
-
public class BoolEventListener : MonoBehaviour
|
|
18
|
+
public class BoolEventListener : MonoBehaviour, IDebugBehaviour
|
|
19
19
|
{
|
|
20
|
+
public bool isDebug
|
|
21
|
+
{
|
|
22
|
+
get => _isDebug;
|
|
23
|
+
set => _isDebug = value;
|
|
24
|
+
}
|
|
25
|
+
[SerializeField] private bool _isDebug = false;
|
|
26
|
+
|
|
20
27
|
[SerializeField] private BoolEventChannelSO _channel = default;
|
|
21
28
|
|
|
22
29
|
public BoolEvent OnEventRaised;
|
|
@@ -36,6 +43,7 @@ namespace jeanf.EventSystem
|
|
|
36
43
|
private void Respond(bool value)
|
|
37
44
|
{
|
|
38
45
|
OnEventRaised?.Invoke(value);
|
|
46
|
+
if(isDebug) Debug.Log($" bool event raised: {value}");
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
using jeanf.EventSystem;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
public class BoolEventSender : MonoBehaviour, IDebugBehaviour
|
|
5
|
+
{
|
|
6
|
+
public bool isDebug
|
|
7
|
+
{
|
|
8
|
+
get => _isDebug;
|
|
9
|
+
set => _isDebug = value;
|
|
10
|
+
}
|
|
11
|
+
[SerializeField] private bool _isDebug = false;
|
|
12
|
+
|
|
13
|
+
[field: Header("Broadcasting on:")] public BoolEventChannelSO boolMessageChannel;
|
|
14
|
+
|
|
15
|
+
public void SendBool(bool value)
|
|
16
|
+
{
|
|
17
|
+
boolMessageChannel.RaiseEvent(value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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: e0ed7a8546959a8479bb135ed3cf5fc1, type: 3}
|
|
13
|
+
m_Name: GloveState Event Channel SO
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
_guid:
|
|
16
|
+
description:
|
package/package.json
CHANGED