Open friuns2 opened 6 years ago
Unfortunately Rex is unable to do this.
This is due to the way Rex creates the compiled scripts. There are two seperate parts to Rex, first there is the code compleation which uses reflection to find the avilable functions and properties of a given type. The secound is the compaliation of the expression provied.
For exampe the code Selection.activeContext
gets translated into a body like so:
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
class __TempRexClass
{
public Func<object> Func()
{
return new Func<object>(() => Selection.activeContext);
}
}
Which is compiled and then executed. Note this snipit of code has the same ristrictions as any other when it comes to private variables.
Workaround is to change the member to public while debuging and change it back once done.
I could be more smart about using reflection to acess the values for a given expression.
Hi i found something, there is c# interpreter on github called SlowSharp, if you run scripts with it and you need modify its source code so bool IsAcceesible returning always true
i tested it with accessing private variable and it did work
When i try to access private variable T-Rex throws error https://i.imgur.com/OwJUjuk.png
how can i access private variable?