can a c# script don`t inherbit the Class MonoBehaviour?

i want to make a c# script that dont inherbit the Class MonoBehaviour. Lets speak out the reason why i want to do that.As we know,MonoBehaviour is a component in the unity,but i want to make a script as the a event that tell some gameobjects what to do?
Is that realizable?

please give me a tip!

Hi Starky,

I’m new to this as well but from what I’ve seen it seems that all scripts (in all languages) inherit from MonoBehaviour.

taken from Unity Script Reference - MonoBehaviour

I’ve found the examples on the Unify wiki really useful for learning how to do things:

I think this one is a good place to start:

ConstantVelocity

You can indeed create scripts (and hence classes) which do not inherit from MonoBehaviour, but be aware that you cannot then attach them to GameObjects. A class needs to inherit from MonoBehaviour so that it has the base functionality all scripts need to be attached to gameobjects.

So any classes you create that don’t inherit from MonoBehaviour will only be able to be used by other classes which do inherit from MonoBehaviour.

I can’t make out from your description whether or not this is a problem for you.