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.
@@ -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
  }
@@ -1,9 +1,9 @@
1
- using System;
2
1
  using UnityEngine;
3
2
  using UnityEngine.Events;
4
3
 
5
4
  namespace jeanf.EventSystem
6
- {[System.Serializable]
5
+ {
6
+ [System.Serializable]
7
7
  public class VoidEvent : UnityEvent<object>
8
8
  {
9
9
 
@@ -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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 97089b669d0079a4aa9e4695271e9dc6
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,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:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 44afa38efccaafb40b05699ac6bd3740
3
+ NativeFormatImporter:
4
+ externalObjects: {}
5
+ mainObjectFileID: 11400000
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"fr.jeanf.eventsystem",
3
- "version":"0.1.2",
3
+ "version":"0.1.4",
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",