Skip to content

Commit 78f0e4f

Browse files
committed
Add vector2int gameevent
1 parent 46feea7 commit 78f0e4f

11 files changed

+113
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace RaCoding.GameEvents
5+
{
6+
[CustomEditor(typeof(GameEvent<Vector2Int>), editorForChildClasses: true)]
7+
public class Vector2IntGameEventEditor : GameEventEditor<Vector2Int>
8+
{
9+
public Object source;
10+
11+
protected override Vector2Int GetValue()
12+
{
13+
return EditorGUILayout.Vector2IntField("Vector2Int", new Vector2Int(1, 1));
14+
}
15+
}
16+
}

Packages/SOGameEvents/Editor/Vector2IntGameEventEditor.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using UnityEngine;
2+
using UnityEngine.Events;
3+
4+
namespace RaCoding.GameEvents
5+
{
6+
[System.Serializable]
7+
public class Vector2IntUnityEvent : UnityEvent<Vector2Int> { }
8+
}

Packages/SOGameEvents/Runtime/Events/UnityEvents/Vector2IntUnityEvent.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using UnityEngine;
2+
3+
namespace RaCoding.GameEvents
4+
{
5+
[CreateAssetMenu(fileName = "Vector2IntGameEvent", menuName = "RaCoding/GameEvent/Create new vector2int game event")]
6+
public class Vector2IntGameEvent : GameEvent<Vector2Int> { }
7+
}

Packages/SOGameEvents/Runtime/Events/Vector2IntGameEvent.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using UnityEngine;
2+
3+
namespace RaCoding.GameEvents
4+
{
5+
[AddComponentMenu("RaCoding/GameEvents/Vector2IntGameEventListener")]
6+
public class Vector2IntComponentGameEventListener : ComponentGameEventListener<Vector2IntGameEventListener, Vector2Int> { }
7+
}

Packages/SOGameEvents/Runtime/Listener/Component/Vector2IntComponentGameEventListener.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using UnityEngine;
2+
using UnityEngine.Events;
3+
4+
namespace RaCoding.GameEvents
5+
{
6+
[System.Serializable]
7+
public class Vector2IntGameEventListener : GameEventListener<Vector2Int>
8+
{
9+
public Vector2IntGameEventListener() : base() { }
10+
11+
public Vector2IntGameEventListener(IRegisterListener registerListener) : base(registerListener) { }
12+
13+
[SerializeField] private Vector2IntGameEvent vector2intEvent;
14+
[SerializeField] private Vector2IntUnityEvent vector2intResponse;
15+
16+
public override GameEvent<Vector2Int> Event => vector2intEvent;
17+
public override UnityEvent<Vector2Int> Response => vector2intResponse;
18+
}
19+
}

Packages/SOGameEvents/Runtime/Listener/Vector2IntGameEventListener.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Install with the Unity Package Manager: https://github.com/Ra-Coding/unity-scrip
2222
- char
2323
- string
2424
- Vector2
25+
- Vector2Int
2526
- Vector3
2627
- GameObject
2728
- Transform

0 commit comments

Comments
 (0)