Megafunk / MassSample

My understanding of Unreal Engine 5's experimental ECS plugin with a small sample project.
MIT License
681 stars 112 forks source link

IDE file templates for Mass Processor boilerplate #22

Open Megafunk opened 2 years ago

Megafunk commented 2 years ago

Seems like you can share Rider file template configs. It would be cool to make it faster to create Mass code with some IDE shortcuts!

EntityQuery.ForEachEntityChunk(EntitySubsystem,Context,[&](FMassExecutionContext& Context)
{
   const int32 QueryLength = Context.GetNumEntities();

   for (int32 i = 0; i < QueryLength; ++i)
   {

   }
});

(no clue how to share it lol, I added it in Editor>Live Templates>C++)

Does VAX/vanilla VS have anything like this? If it does and you make one we can include that somewhere too.

cupsster commented 2 years ago

For quick tag Rider C++ live template:

USTRUCT()
struct $CLASS_MODULE_API_MACRO$ F$NAME$ : public FMassTag {GENERATED_BODY()};$END$

Where: $CLASS_MODULE_API_MACRO$ set to Non-Editable "Substitute Unreal template macros" macro with value CLASS_MODULE_API_MACRO $NAME$ set to Editable "Constant value" macro with value MyMassTag

Will produce:

USTRUCT()
struct MASSSAMPLE_API FMyMassTag : public FMassTag
{
    GENERATED_BODY()
};

I'm not yet sure how Rider templates could be shared except saving them as "team-shared", maybe gitignore need some love. It would be super nice if they could be stored in file and shared easily...

hvent90 commented 1 year ago

In regards to sharing templates: https://www.jetbrains.com/help/rider/Sharing_Live_Templates.html