- Home /
Question by
mogoling · Oct 10, 2012 at 08:59 AM ·
c#javascriptreferencecollapse
try to use values of c# script in a Javascript, Unity collapsed
I'm doing a test, trying to deal with data from a c# in a Javascript. I have put the Javascript outside the standard Assert folder and the compilation was fine. But Unity collapse everytime when I try to run. I'm just reading a variable from c#: c#script:
using UnityEngine;
using System.Collections;
public class TestNumber : MonoBehaviour {
public int Num=33;
// Use this for initialization
void Start () {
Num=33;
}
// Update is called once per frame
void Update () {
}
}
The Javascript:
#pragma strict
var serialInformation:TestNumber;
var count:int;
function Start () {
count=0;
}
function Update () {
count = serialInformation.Num;
print(count);
}
Comment
fortunately, 1000s of questions on here about this issue !
http://answers.unity3d.com/questions/208383/referencing-a-c-component-script-from-js-script.html
just go via the plugins folder
Your answer
![](https://koobas.hobune.stream/wayback/20220613082133im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Reference JS string to C# 1 Answer
Reference C sharp script from Javascript 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Character falls through the ground 1 Answer