Hello. I have NGUI working for interface widgets grouped under in the NGUI camera. I can also get everything working if I drag widgets outside of that hierarchy and use the UICamera script on the other cameras. But the UICamera script messes up my other camera scripts and the main camera looses its swipe navigation abilities. So I am looking for a work around.
So I want to put regular geometry with colliders in front of the non-NGUI cameras and when clicked, trigger animations on the NGUI panels (actually on the empty game objects that my panels are nested under)
That is all I am trying to do.. trigger certain panels to animate onto and off of screen.. They work when triggered from within the NGUI hierarchy, but I need them to ALSO animate when random, non-gui game objects are clicked.
My NGUI camera and all widgets are on their own layer (mygui), and my other cameras are all set to default layer. This is the script that I am using. I attach it to a cube with a box collider on it, and drag the animated game object tot he exposed variable.. and then I name the clip explicitly.
funny thing is, that this script works.. but only once. It gets the panel to animate onto screen. The panel has a close button I use to close, it.. and then I try and open it again with this script and only the debug log works.. but no more animation.. To bad the UIplayAnimation script won't work outside of the NGUI hierarchy either, or else I'd use that.. that would be perfect..
Any help would be much appreciated.. Sorry for the long explanation.
//------------------------------------
var target : GameObject;
function OnMouseDown()
{
// this works but only once each time scene is restarted..??
target.animation.Play("NGUI_doc_in");
Debug.Log("you have clicked on mesh to trigger anim");
// debug log seems to fire every time, but not the animation
}
//-------