Reading private variables
string myvalue = Traverse.Create(ScriptInstance).Field("fieldname").GetValue() as string;
// For example to get the value "m_MinFallingHeight" of the class Player we can do that :
float val = Traverse.Create(Player.Get()).Field("m_MinFallingHeight").GetValue() as float;string myvalue = Traverse.Create(typeof(classname)).Field("fieldname").GetValue() as string;
// For example to get the value "s_Initialized" of the class ItemIDHelpers we can do that :
bool myvalue = Traverse.Create(typeof(ItemIDHelpers)).Field("s_Initialized").GetValue() as bool;Last updated