I am both a Unity beginner and nGUI extreme beginner so bear with me please

- (1) I would like to create one button that toggles the meshrenderer on & off for a number of meshes in my scene
- (2) I would like to create a button that plays an animation.
- I'd like for them to work with both onClick and onPress (desktop and tablet)
So I've created my buttons in nGUI using labels and added a box collider to them each, enabling 'Is Trigger'.
I've added a UIEvent Trigger script to them both as well (as I read button scripts only cater for onClick).
Re (1)
Any chance you can give me a hand C# scripting this? Using
OnGUI, and with the object called T13_L in the Inspector I would do something like...
public bool T13_L = false;
void Update ()
if T13L == true;
{
MeshRenderer T13L GameObject.Find ("T13_L") <GetComponent.MeshRenderer()>
T13L.renderer.enabled = !T13L.renderer.enabled
}
Now I need to make my own public class right?
So something like
public void toggleMeshesLSide ()
{
MeshRenderer T13L GameObject.Find ("T13_L") <GetComponent.MeshRenderer()>
T13L.renderer.enabled = !T13L.renderer.enabled
}
Drag this into the onClick slot and onPress slot on the UIEvent Trigger and should be good to go? Didn't work for me earlier...
----------------------------------------------------------------------
Re (2)
My animation clip is called "X_impulse". The animator is called "X" as this is the game object it's attached to obviously.
public void playAnimation()
{
animation.Play();
}
Now I can attach this to the gameobject in question, then drag the gameobject to the UI Event trigger slots for onClick and onPress? Didn't work for me earlier either.
Or could I have a script referencing multiple animations using
public void X_impulse()
{
animation.Play("X impulse");
}
void X_impulse2()
{
animation.Play("X impulse 2");
}
And then use the dropdown menu to select the correct animation?
I realise there's probably all sorts of mistakes in there, apologies.
All help appreciated,
A