I have 8 pieces of geometry, which basically have the same code on them, named Link1->Link8.
http://forum.unity3d.com/viewtopic.php?t=6473
function OnMouseUp(){
var go = GameObject.Find("Link1");
go.GetComponent("LoadParentFrameFunction").enabled = false;
}
Could I, instead of duplicating the script 8 times correcting the GameObject name, use an array for this, so it runs the script for each object?
function OnMouseDown(){
if(enabled){var go = GameObject.Find("Main Camera");
go.GetComponent("MouseLook").enabled = false;
Application.ExternalCall("parent.showHideText", "address1");
}
}
Also this script is basically the same for all 8 objects, only the string in ExternalCall is different from the 8 objects.
I have never used array (or programmed much entirely), so any help would be highly appreciated.