-
Notifications
You must be signed in to change notification settings - Fork 1
Split up & simplify library #30
Comments
I think that In a situation where each event would receive an object, we could store quite a lot of info in each event argument instance. This would be beneficial for: #27, #23 and #22. One downside of this approach is that performance might tank, but in contrast it would make the API a lot more flexible. |
@Edvinas01 Just thought I might share my thoughts as I'm currently using this library a lot 😄 I have also used this library in a couple of projects now and every time I made strong use of the As for the second comment, I agree it would make sense to have Another thing is adding additional info to each event argument instance, which might be heavy, so it would be great to have a possibility of switching between a debug mode, where this info is passed along each call as well as a production mode where the arguments are stripped to a minimum. |
@KacperKenjiLesniak Its awesome to hear that you're using it! I'm planning on plugging it into my thesis project as well :D
I think your argument is sound. I was thinking of how this could be tackled without screwing everyone who relies on this package (even if the number of users is tiny). I'm thinking the best approach right now is to make 2 new packages/repositories - one for the events (almost ready) and one for the mutable objects, then they could be linked in the I feel that combining them doesn't make much sense as they do different things. Also its hard to give a fitting name when keeping them both in the same place :x Also I'm curious, did you find the ResetType functionality useful?
Currently I've setup something along those lines ( namespace ScriptableEvents.Simple
{
[CreateAssetMenu(
fileName = "SimpleScriptableEvent",
menuName = "Scriptable Events/Simple Scriptable Event",
order = -10
)]
public class SimpleScriptableEvent : BaseScriptableEvent<SimpleArg>
{
/// <summary>
/// Raise this event without an argument.
/// </summary>
public void Raise()
{
Raise(SimpleArg.Instance);
}
}
} And the namespace ScriptableEvents.Simple
{
public class SimpleArg
{
public static readonly SimpleArg Instance = new SimpleArg();
private SimpleArg()
{
}
}
}
I was hoping that the |
The new "game event" package can be found here: With a slim change-log for the upcoming release: Right now its missing automation and its "first" release. |
The first release (second with a hotfix) is up and running at https://github.com/chark/scriptable-events. I've also registered the package on OpenUPM as well for ease of use. I've closed existing issues on this repository and migrated relevant ones to the |
I've used this library in multiple projects now, it seems that the most useful part is events. I honestly used
MutableObject
just a few times and its usefulness even then was questionable. If it turns out that theMutableObject
functionality is needed, it can be moved to a separate library as not to bloat this one.Given this, I think the following steps would make most sense (throughout multiple releases):
MutableObject
functionality.GameEvent
andGameArgumentEvent
.MutableObject
functionality.*Events
, as the focus is only on events.The text was updated successfully, but these errors were encountered: