Skip to content

How to access script objects statically? #247

Answered by ClearScriptLib
Zeon8 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Zeon-4,

All script objects are instances of ScriptObject. You can use that class as an alternative to dynamic:

var root = (ScriptObject)engine.Script;
var math = (ScriptObject)root.GetProperty("Math");
Console.WriteLine(math.GetProperty("PI"));

Good luck!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zeon8
Comment options

Answer selected by Zeon8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants