I have created a Unity C# script which I want to use to store data for the objects it's attached to.
The class only has two fields, and does not have any behaviour. Because it doesn't have any behaviour, it feels unnecessary to extend MonoBehaviour
.
Ideally I would like to extend nothing at all, but I have also tried to extend Behaviour
(which MonoBehaviour
extends) and in both cases I get the following error in the sidebar against the script:
The associated script can not be loaded. Please fix any compile errors and assign a valid script.
Is it possible for me to attach a script to an object without that script extending MonoBehaviour
?