Require Component in Interface

I just implemented the save system and if you have values to save you also need the “SaveableEntity.cs” script attached to the gameojbect for it to work.

Is it possible to have it structured in such a way that the Interface also adds the [RequireComponent(oftype(SaveableEntity))] in any way? So I don’t forget to add it and then miss saving the values

2 Likes

Unfortunately, [RequireComponent] can only be used on class declarations. That would be a fantastic idea, though. You might suggest it on the Unity forums.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms