- Home /
Question by
zak666 · Feb 28, 2015 at 07:12 PM ·
scripting problem
Calling a Static float From C# script from java?
Hi, I'm looking froa way to call a Float in a C# script and trying to call it in a Java scipt, says cannot find Ghoststeets.GhoststreetsActive, when it's set at a static float In my C# script.
#pragma strict
var cameraMain : Camera;
var camera3rd : Camera;
function Start () {
cameraMain.enabled = true;
camera3rd.enabled = false;
}
function Update () {
if (GhostSteets.GhostsstreetsActive == 1);{
if ( cameraMain.enabled == true){
camera3rd.enabled = true;
cameraMain.enabled = false;
}
}
if (GhostSteets.GhostsstreetsActive == 0);{
if ( cameraMain.enabled == false){
camera3rd.enabled = false;
cameraMain.enabled = true;
}
}
Comment
Answer by maccabbe · Feb 28, 2015 at 07:17 PM
To access variables between languages you need to compile the accessie first, otherwise the accessor can't find the other script.
http://answers.unity3d.com/questions/10856/cant-find-namespace-accessing-javascript-from-c-or.html http://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html