c# Class

Hello!
Is there any known problem with inheritance / polymorphism on clases in same file?
Should I put all clases into seperated files?

I get
“Instance of OrderAdd couldn’t be created because there is no script with that name”

while:

public class OrderAdd : Order

and

public class Order : ScriptableObject

Both of them are in file named as class which control orders(“OrderControl.cs”). (part of state machine)

Thanx fort any tip

Descendants of ScriptableObject / MonoBehavior need to be in a script file with the same name as the class.
Unity automagically will allow you to use those classes then in the editor to assign them to fields (for example if you have a public ScriptableObject state field in your class).

As a sidenote: its common (and good) practice in C# that each class has its own file which has the same name as the class

Thanx, Tests in progress x]