I want to use coroutines with an object created on the fly.
I make:
GameObject _instance = new GameObject("My Timer");
MonoBehaviour _mono = _instance.AddComponent<MonoBehaviour> ();
inside MyClass.
Is is correct?
If so, why on the inspector (when pressing PLAY), I read “The associated script can not be loaded. Please fix any compile errors and assign valid script”?