- Home /
Question by
Zerker47 · Feb 16, 2012 at 07:16 PM ·
javascriptprogrammingjavascript-specific
Referencing A Class From A Different Script ( Javascript )
What I'm trying to do is create separate scripts for each of the classes I'm using for one object.
For Example:
Script A:
class A
{
var objectA : int = 0;
function GetObjectA()
{
return objectA;
}
function SetObjectA( value : int )
{
objectA = value;
}
}
Script B
var scriptA : A;
function Update()
{
print( scriptA.GetObjectA() );
}
Obviously I didn't do the actual syntax. I'm kinda stumped at this point on how to actually go about doing this and having the values update correctly if referenced outside their actual script.
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to set parents of all objects in an array? 1 Answer
Too many bugs 0 Answers
How to approach different game modes 2 Answers