Entitas-csharp: Add systems and components to "create" menu in Unity

Created on 19 Mar 2017  路  5Comments  路  Source: sschmid/Entitas-CSharp

I don't know whether or not this is possible with Unity, but I'd love to be able to right-click in the Unity project explorer and see Create->ReactiveSystem or Create->Component.

As Unity does for monobehaviours, this should create a blank template with the appropriate methods declared and empty. I feel like i spend far too much time copy-pasting from other systems in my project.

Most helpful comment

Sounds like the IDE would be a better place to achieve this, practically any IDE nowadays will have some way to do templates in a more streamlined and straightforward way.

All 5 comments

It's a pretty trivial task actually. You can even make first steps towards that. Take a look at custom editor scripts, there's a way to inject your methods to "Create" menu in project view.
https://forum.unity3d.com/threads/custom-context-menu-for-project-view.127021/
Then just add a few modal windows that ask a user about the type of an entity (GameEntity, InputEntity or whatever contexts there are in project), then just generate some code without any complicated code generation stuff (simple hardcoded stuff will do). It's absolutely possible in Unity and even more than that, it's pretty easy

Sounds like the IDE would be a better place to achieve this, practically any IDE nowadays will have some way to do templates in a more streamlined and straightforward way.

Yeah, I understand that it's fairly easy within the IDE, but I want to be able to do it through until. I'll follow @KumoKairo's advice for now. Would be nice to add this to the Unity Addons part of Entitas.

Wrote this so you can use as a base:

https://gist.github.com/WoLfulus/79bb7d38da84a48800d6857d67c9108a

An addon like this will be nice with common "templates"

Hey, sounds useful and is sth you can easily do to if you want. For now I won't add and maintain sth like this in Entitas. Hope that's ok.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesMcMahon picture JamesMcMahon  路  5Comments

CuriousHub picture CuriousHub  路  5Comments

Noicon picture Noicon  路  4Comments

angelotadres picture angelotadres  路  5Comments

jakovd picture jakovd  路  3Comments