Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - arumiat

Pages: [1]
1
NGUI 3 Support / Getting access to multiple scripts from a button
« on: June 27, 2015, 11:43:26 AM »
Hi guys,

Whilst I've been 'using' NGUI for a year now my developer has done most of the actual NGUI setup so I've never really had to dive in and learn it myself. It's getting to the point now whereby I need to be able to iterate faster and I really ought to start understanding things myself. I've watched the getting started tutorials, but I'm slightly stumped by a few things.

Initially I was setting up NGUI for each & every scene in my project. My developer pointed out this is idiotic and now we have a single 'UI' scene. This scene then references and loads the other scenes in the project within it. It looks as though my dev wrote a custom script to do this UI Manager

2 current issues:
1)  I'm not sure how to disable and enable certain NGUI elements on a per-scene basis. For instance in scene A I would like a 'Play' button to show, but for this same button to be hidden in Scene B. Can anyone point me to some relevant documentation for this?

2) I've added a new script to my game that causes lots of objects to burst apart when a input is pressed (you define the input in the Editor). In my case I have set this input on the object to be Spacebar.


How can I Notify this script via the NGUI play button? I created a prefab of the object in the scene where the exploding script is and dragged that to the On Notify field, however none of the dropdowns actually make the script work like they do in the actual scene itself.


Do I need to modify this exploding script (I tried making the key a public rather than private variable, but this didnt change the dropdown), or is there something I need to do to NGUI?


Thanks for any advice,
T

2
NGUI 3 Support / Converting GetKeyDown input to UIButton sprite input
« on: October 21, 2014, 03:40:23 AM »
Hi all

I have a script that currently allows gives me keyboard input to move an object within my scene, like so

  1. public class PlaneMovement : MonoBehaviour {
  2.  
  3.         public float moveSpeed = 10.0f;
  4.        
  5.         // Use this for initialization
  6.         void Start () {
  7.        
  8.         }
  9.        
  10.         // Update is called once per frame
  11.         public void Update () {
  12.        
  13.                 transform.Translate(Vector3.up * Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed);
  14.  
  15.                 if (Input.GetKey (KeyCode.W))
  16.                 {
  17.                         transform.Rotate (Vector3.right, Space.Self);
  18.                 }
  19.  
  20.                 if (Input.GetKey (KeyCode.S))
  21.                 {
  22.                         transform.Rotate (Vector3.left, Space.Self);
  23.                 }
  24.  
  25.  
  26.                 if (Input.GetKey (KeyCode.RightArrow))
  27.                 {
  28.                         transform.Rotate (Vector3.up, Space.Self);
  29.                 }
  30.  
  31.                 if (Input.GetKey (KeyCode.LeftArrow))
  32.                 {
  33.                         transform.Rotate (Vector3.down, Space.Self);
  34.                 }
  35.  
  36.                 if (Input.GetKey (KeyCode.A))
  37.                 {
  38.                         transform.Rotate (Vector3.back, Space.Self);
  39.                 }
  40.  
  41.                 if (Input.GetKey (KeyCode.D))
  42.                 {
  43.                         transform.Rotate (Vector3.forward, Space.Self);
  44.                 }
  45.         }
  46. }

Now I'd like to create an extremely simple interface to test my scene on a tablet device, so just 8 sprites in a line (or even just 1 to start off with), each of which will reference one of the keys above.

I've created the sprites, attached UIButton scripts and colliders and tried writing a new script with individual void functions, each referencing one of the above buttons, but no luck working (i'm testing initially with just the mouse).

Can anyone point me in the direction or provide an example of how I can add to this current code to get the result I'm looking for? I have a feeling it's to do with 'delegates' but the Microsoft explanation on this was far too complicated for me sadly.

Thanks in advance

3
Misc Archive / NGUI expert with an eye for design
« on: August 25, 2014, 05:43:42 AM »
Hi guys

I've got a semi-finished NGUI interface that needs some modifications. Change a menu from slide to fade in, clean up the interface in terms of alignment, so relatively straightforward tasks/ a short job. However I really need someone who's going to pay attention to the mockup and basically has an eye for design and an attention to detail. If you've got experience working with vector graphics would be a huge plus. If you're interested please get in contact, there's definitely the likelihood of ongoing work for a person who does a good job.

Thanks
A

4
NGUI 3 Support / Re: Scripting UI Event Triggers
« on: July 27, 2014, 03:34:00 AM »
Thanks Aren that's very helpful. Will check out the tutorials again.

5
NGUI 3 Support / Scripting UI Event Triggers
« on: July 26, 2014, 01:39:20 PM »
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...
  1. public bool T13_L = false;
  2.  
  3. void Update ()
  4.         if T13L == true;
  5.         {
  6.                 MeshRenderer T13L GameObject.Find ("T13_L") <GetComponent.MeshRenderer()>
  7.                 T13L.renderer.enabled = !T13L.renderer.enabled
  8.         }

Now I need to make my own public class right?
So something like

  1.  
  2. public void toggleMeshesLSide ()
  3. {
  4. MeshRenderer T13L GameObject.Find ("T13_L") <GetComponent.MeshRenderer()>
  5.                 T13L.renderer.enabled = !T13L.renderer.enabled
  6. }
  7.  
  8. 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...
  9.  


----------------------------------------------------------------------
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.

  1. public  void playAnimation()
  2.     {
  3.         animation.Play();
  4.     }
  5.  

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

  1.  public void X_impulse()
  2.     {
  3.         animation.Play("X impulse");
  4.     }
  5.  
  6.     void X_impulse2()
  7.      {
  8.         animation.Play("X impulse 2");
  9.     }
  10.  
  11.  

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


6
Misc Archive / NGUI basics tuition
« on: July 24, 2014, 04:33:01 AM »
Hi guys

I'm looking for 1-2hours of tuition on nGUI via Teamviewer and Skype. Have some very very basic needs but it's taking me ages to understand what's going on so far!

Willing to pay an hourly rate, please let me know if you're interested.

Thanks

7
NGUI 3 Support / Importing nGUI offline
« on: July 24, 2014, 03:38:34 AM »
Hi guys

At the moment whenever I want to use nGUI I have to load up Unitys asset store and download into my project. This is all fine and dandy for when I've got an internet connection but how can I store it offline as a package that I can just import into my project for when needed?

As I'll always be using it pretty much would be nice for Unity to open into Michaels standard layout each time I open Unity, I automatically import nGUI too.

Thanks in advance

Pages: [1]