Hi,
I have script-A which has an array in it, like :
var testArray : int[];
var bullet : Transform;
function Update()
{
testArray = new Array(2);
testArray[0] = 4;
testArray[1] = 7;
if (Input.GetKeyDown (KeyCode.KeypadEnter))
{
bullet.BroadcastMessage("fire", testArray)
}
}
This is Script-B which is attached to another game object. I don’t know how to pass an test Array as an arrgument
//SCRIPT-B
var bulleCount : int[] ;
function Update()
{
bulleCount = new Array(2);
}
function fire ( receivedData : int[] ) // ???????????????
{
bulleCount = receivedData;
}
This doesn’t work. Does anyone have any idea? How can I pass the testArray to fire function as an argument?