New to Unity and c# I get:
CreateInstance can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
How to rewrite and/or put into the main cs?
private BSplineMath bmath = ScriptableObject.CreateInstance("BSplineMath") as BSplineMath;
If I put that in the main class I get a reference error:
error CS0103: The name `bmath' does not exist in the current context
No wonder, how to use an instance in another class. In c++ I would only
include the header?
Many thanks in advance
Edited by FGFS, 27 August 2014 - 02:20 AM.