unity3d - Inheritance and Monohehaviour -


this question has answer here:

the initial issue unity yelling @ me :

you trying create monobehaviour using 'new' keyword.

i checked lines directed , got more confused.

in monobehaviour class calling non-inheriting class 'new' keyword , attempted use function in monobehaviour class. ie :

public void monomethod() {      mynonmonoscript scriptname = new mynonmonoscript();       scriptname.nonmonofunction(); } 

can elaborate this, please?

i found it. creating monobehaviour 'new' keyword , in mynonmonoscript's other functions doing mono creation 'new' keyword... ...oops...


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

javascript - Solution fails to pass one test with large inputs? -