fr.jeanf.eventsystem 0.1.80 → 0.1.82
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/Editor/SendBoolEventOnClick.cs +37 -0
- package/Runtime/Editor/SendBoolEventOnClick.cs.meta +11 -0
- package/Runtime/Editor/SendIntEventOnClick.cs +36 -0
- package/Runtime/Editor/SendIntEventOnClick.cs.meta +11 -0
- package/Runtime/Editor/SendStringEventOnClick.cs +37 -0
- package/Runtime/Editor/SendStringEventOnClick.cs.meta +11 -0
- package/Runtime/Editor/SendVoidEventOnClick.cs +33 -0
- package/Runtime/Editor/SendVoidEventOnClick.cs.meta +11 -0
- package/Runtime/{Channels.meta → Editor.meta} +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
|
|
3
|
+
using jeanf.EventSystem;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace uvs.tools
|
|
8
|
+
{
|
|
9
|
+
public class BoolEventOnClick : MonoBehaviour
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
[Header("Broadcasting on:")] [SerializeField]
|
|
13
|
+
private BoolEventChannelSO TestChannel;
|
|
14
|
+
|
|
15
|
+
[Space(20)]
|
|
16
|
+
[SerializeField] private bool valueToSend = false;
|
|
17
|
+
|
|
18
|
+
public void CallFunction()
|
|
19
|
+
{
|
|
20
|
+
TestChannel.RaiseEvent(valueToSend);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[CustomEditor(typeof(BoolEventOnClick))]
|
|
25
|
+
public class BoolEventOnClickEditor : Editor {
|
|
26
|
+
override public void OnInspectorGUI () {
|
|
27
|
+
DrawDefaultInspector();
|
|
28
|
+
var eventToSend = (BoolEventOnClick)target;
|
|
29
|
+
if(GUILayout.Button("Send bool", GUILayout.Height(30))) {
|
|
30
|
+
eventToSend.CallFunction(); // how do i call this?
|
|
31
|
+
}
|
|
32
|
+
GUILayout.Space(10);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#endif
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
|
|
3
|
+
using jeanf.EventSystem;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace uvs.tools
|
|
8
|
+
{
|
|
9
|
+
public class SendIntEventOnClick : MonoBehaviour
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
[Header("Broadcasting on:")] [SerializeField]
|
|
13
|
+
private IntEventChannelSO TestChannel;
|
|
14
|
+
|
|
15
|
+
[Space(20)]
|
|
16
|
+
[SerializeField] private int messageToSend = 1;
|
|
17
|
+
public void CallFunction()
|
|
18
|
+
{
|
|
19
|
+
TestChannel.RaiseEvent(messageToSend);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[CustomEditor(typeof(SendIntEventOnClick))]
|
|
24
|
+
public class IntEventOnClickEditor : Editor {
|
|
25
|
+
override public void OnInspectorGUI () {
|
|
26
|
+
DrawDefaultInspector();
|
|
27
|
+
var eventToSend = (SendIntEventOnClick)target;
|
|
28
|
+
if(GUILayout.Button("Send int", GUILayout.Height(30))) {
|
|
29
|
+
eventToSend.CallFunction(); // how do i call this?
|
|
30
|
+
}
|
|
31
|
+
GUILayout.Space(10);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#endif
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
|
|
3
|
+
using jeanf.EventSystem;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace uvs.tools
|
|
8
|
+
{
|
|
9
|
+
public class SendStringEventOnClick : MonoBehaviour
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
[Header("Broadcasting on:")] [SerializeField]
|
|
13
|
+
private StringEventChannelSO TestChannel;
|
|
14
|
+
|
|
15
|
+
[Space(20)]
|
|
16
|
+
[SerializeField] private string messageToSend = "Test123";
|
|
17
|
+
|
|
18
|
+
public void CallFunction()
|
|
19
|
+
{
|
|
20
|
+
TestChannel.RaiseEvent(messageToSend);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[CustomEditor(typeof(SendStringEventOnClick))]
|
|
25
|
+
public class StringEventOnClickEditor : Editor {
|
|
26
|
+
override public void OnInspectorGUI () {
|
|
27
|
+
DrawDefaultInspector();
|
|
28
|
+
var eventToSend = (SendStringEventOnClick)target;
|
|
29
|
+
if(GUILayout.Button("Send string", GUILayout.Height(30))) {
|
|
30
|
+
eventToSend.CallFunction(); // how do i call this?
|
|
31
|
+
}
|
|
32
|
+
GUILayout.Space(10);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
|
|
3
|
+
using jeanf.EventSystem;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace uvs.tools
|
|
8
|
+
{
|
|
9
|
+
public class SendVoidEventOnClick : MonoBehaviour
|
|
10
|
+
{
|
|
11
|
+
[Header("Broadcasting on:")] [SerializeField]
|
|
12
|
+
private VoidEventChannelSO TestChannel;
|
|
13
|
+
|
|
14
|
+
public void CallFunction()
|
|
15
|
+
{
|
|
16
|
+
TestChannel.RaiseEvent();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[CustomEditor(typeof(SendVoidEventOnClick))]
|
|
21
|
+
public class VoidEventOnClickEditor : Editor {
|
|
22
|
+
override public void OnInspectorGUI () {
|
|
23
|
+
DrawDefaultInspector();
|
|
24
|
+
var eventToSend = (SendVoidEventOnClick)target;
|
|
25
|
+
if(GUILayout.Button("Send void", GUILayout.Height(30))) {
|
|
26
|
+
eventToSend.CallFunction(); // how do i call this?
|
|
27
|
+
}
|
|
28
|
+
GUILayout.Space(10);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#endif
|
package/package.json
CHANGED