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

Pages: [1]
1
NGUI 3 Support / Re: Drag and Drop problem...
« on: April 23, 2014, 06:38:38 AM »
Yup! That did the trick. Thanks for that. It was really obvious as well, so I don't quite know how I managed to miss it.

2
NGUI 3 Support / Drag and Drop problem...
« on: April 22, 2014, 11:40:52 AM »
Hey all,

I've got a drag and drop set up on a grid, taken from one of the example scenes.

The original would scroll when you dragged up or down on the buttons, and detach the button to reorder then when you dragged sideways.

However I only have five and have stopped them scrolling up and down. The problem is that I can still only drag to detach from the rest by going sideways.

Is there a way to drag and detach up and down as well?

Do I need to post more details to explain it better?

3
NGUI 3 Support / Re: Disable button script
« on: January 06, 2014, 12:44:33 PM »
Thanks ArenMook! Makes a lot more sense now :)

I'm still learning, so some obvious scripting is lost on me.

Cheers!  ;D

4
NGUI 3 Support / Re: Disable button script
« on: January 06, 2014, 11:24:53 AM »
Ok, so in theory that works, but now my new problem:

I want to add a public gameObject reference - this being the object I have the variableHolder script attached to in order to track player cash. However it will not show up as a field on the editor (UIButton script) to be able to 'drag and drop' the variableHolder object onto.

Is there a way, without using 'find object' to reference another gameObject on the UIButton script in this way?

Am I missing something simple and obvious?

EDIT: WAIT! This is even more confusing. Editing the UIButton script edits the script for ALL the buttons (of course). It seems like a bad idea for me to even be editing this script, yet how do I set 'isEnabled' = false on the UIButton script from a different script attached to the button. I am not particuarly experienced in coding, so if this is VERY simple and OBVIOUSLY obvious, then perhaps someone can explain it like I'm 5?

5
NGUI 3 Support / Re: Disable button script
« on: January 06, 2014, 11:06:34 AM »
Ah, wait I think I figured out what I need to do. Before writing this I wasn't sure I should be editing the UI Button script, but I see now where to alter it to get this working.

Thanks for your help.

6
NGUI 3 Support / Re: Disable button script
« on: January 06, 2014, 10:55:18 AM »
@ArenMook

Thanks - so I think I need to edit the actual 'UIButton' script, rather than add another script, is that right?

I tried your code, in a variety of places but the most I got was a malfunctioning button. Where exactly and in what context should it be placed so that it greys out the button (as in: it is a 'diabled' button from the point of view of NGUI).

Thanks again,

7
NGUI 3 Support / Disable button script
« on: January 06, 2014, 08:35:19 AM »
Hey folks,

Working on a Tower Defence game and I want to 'grey out' the buttons if the player cash is too low.
I can see a way to have a central 'player cash' variable located on a management object.

How would I then ensure the correct button in the UI is disabled based on the value of this variable (if 'cash' < 'tower value' then button disabled)?

I can apply an additional script to the button, but how does that script then tell the button to disable?

Coding in C#.

Thanks for any help!

Pages: [1]