I stumbled upon something weird:
namespace MyStuff
{
[System.Serializable]
public class MyClass : ScriptableObject
{
public void doSomething(bool flag = false)
{
}
}
}
As soon as I try to create an instance using
MyClass mc = ScriptableObject.CreateInstance<MyClass>();
there is an error:
Instance of MyClass couldn't be created because there is no script with that name.
The fix appears to be making ‘flag’ non optional. Why is that? I’m on 4.1.2.f1
EDIT: Removing the namespace also fixes it.