Primitive ScriptableObject event system for handling events in easy way with UnityEvents.
Add this line to your manifest.json at Packages/
folder in your project.
"com.batuberksahin.soevents": "https://github.com/batuberksahin/so_events.git"
SO_events package contains several types of events. For example, Integer Event takes an integer as a parameter.
These are
- String
- Float
- Integer
- GameObject
- Transform
- Vector2
- Vector3
You can add events from create tab in Assets window.
Also there are equivalent event listeners in the package, so you can add UnityEvents to your custom events. You can add Event Listeners to an object from Add Component/Listeners tab.
Example Usage of Custom Events
Trigger this event;
public class GameManager : MonoBehaviour {
public IntGameEvent onGameOpen;
private void Start()
{
onGameOpen.Raise(0);
}
}
MIT