I have 3 objects in a scene, one of them is not rendered. I need to click on the two visible ones (one after the other) so that the third will appear. I’m starting with the below code to detect the first object. How would I detect them both. Like…
If this is clicked and this is clicked then this becomes visible.
function OnMouseOver ()
{
if(Input.GetMouseButtonDown(0))
Debug.Log("One object clicked");
}
gameObject.renderer.enabled = true/false to toggle visibility
you can make two boolean vars to check against, ie:
var foo1 : boolean;
var foo2 : boolean;
if(foo1 && foo2)
invisibleObject.render.enabled = true
else
invisibleObject.render.enabled = false
gameObject.renderer.enabled = true/false to toggle visibility and
you can make two boolean vars to check against, ie:
var foo1 : boolean;
var foo2 : boolean;
if(foo1 && foo2)
invisibleObject.render.enabled = true
else
invisibleObject.render.enabled = false