Hello, I’ve a problem - I can’t access variables from other scripts.
OutlineController.js
public static var outlinesize_ = 0.7;
InlineController.js
public static var inlinesize_ = 0.3;
PlayerController.js
#pragma strict
// Targets
function Start () {
var outlinescript_ : OutlineController = outlineobject_.GetComponent("OutlineController");
var inlinescript_ : InlineController = inlineobject_.GetComponent("InlineController");
// I can't choose my variables
outlinescript_. <- !
inlinescript_. <- !
}
Since 2 days I was researching, but I still have no solution.
Does anyone has a solution for Unity 5.1.2f1?
static variables are class level and need the class name infront of them
myclass.myvariablename
although, looking again, are you meaning for them to be static?
https://unity3d.com/learn/tutorials/modules/intermediate/scripting/statics
This won’t work for me, the Editor don’t find my script or he don’t allow it as type.