0
votes

In the same place this works:

Debug.Log(gameObject);

And this produces BCE0020: Boo.Lang.Compiler.CompilerError: An instance of type 'UnityEngine.Component' is required to access non static member 'gameObject'.

eval("Debug.Log(gameObject);");

This works:

Debug.Log(this.gameObject);

And this prints 'Null'

eval("Debug.Log(this.gameObject);");

Why? What is the problem with non-static members?

1

1 Answers

0
votes

I think you should code,

var me = this;
eval("Debug.Log(me.gameObject)");

or use bind() method.