I'm creating this game inspired from the famous game "Mystery Case Files". If you don't know the game, it's simply a game where there are items given in a side of panel and you'll have to find all the items before the time runs out.
In my current progress, i can destroy the game object once its clicked using this code attached to a game object that i want to destroy.
function OnMouseOver() {
if(Input.GetMouseButtonDown(0)) {
Destroy(gameObject);
CheckScript.showCheck = true; //just displaying a GUItexture once clicked
}
}
now since there are tons of objects in my game, can i minimize the usage of this script? is it possible to destroy different object using only this script?
oh and also each time I destroy a game object there is also a GUITexture(which is the name of the object) that i need to destroy, i can do it using that script, but is it possible also to use a script that will destroy a specific GUITexture?
I am thinking of a varible where the game object and the GUITexture will be put in there. But it seems i can't do it xD hehehe kinda beginner here :3
Thanks in advance ^^,BlockquoteBlockquote