Quantcast
Channel: Answers for "Can't access Inspector variable in C# Editor script?"
Viewing all articles
Browse latest Browse all 6

Answer by Matthew A

$
0
0

AFAIK, static variables are simply not serializeable. You will need to actually create a TestScript object instance in order to get hold of that value.

e.g.

static void MenuTestScript()
{
    TestScript test = new TestScript();
    OtherClass newClass = new OtherClass(test.myMat)
}

(Of course you may need to refactor your classes if you already use a TestScript instance for other purposes).


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images