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

Pages: [1] 2 3 ... 6
1
Misc Archive / Empires & Allies, made with NGUI
« on: May 05, 2015, 12:32:47 PM »
Empires & Allies is now available worldwide. Welcome to the battlefront, Commanders.

Download for Android: http://bit.ly/Empireall
Download for iOS: http://bit.ly/EADownload

Like us on Facebook! https://www.facebook.com/EmpiresAndAllies

2
I ran into this recently, as well.  The behavior that I was seeing was that unity would return an empty string (or null, I forget which) for mKeyboard.text the frame *before* the keyboard was deactivated.  I worked around it by caching the last non-empty string and which frame the text was cleared on, so if the keyboard was deactivated on the very next frame, I could restore the text to what it was supposed to be.  All of this was conditional on android only, since iOS works fine.

3
Misc Archive / Re: Windward is now out on Steam
« on: March 18, 2015, 10:50:30 PM »

4
NGUI 3 Support / Re: iOS compiler problem
« on: December 01, 2014, 01:28:39 PM »
Is there a space after Editor in those paths?  If so, that's your problem.

5
NGUI 3 Support / Re: Avoiding the garbage collector with UILabel.text
« on: August 29, 2014, 11:57:53 AM »
I hope you're at least checking whether DistanceCurrentScore has changed before doing any of that StringBuilder stuff...

6
NGUI 3 Support / Re: atlas and iOS texture compression
« on: July 24, 2014, 01:14:21 PM »
I thought the easiest way was to check the "Force Square" box in the atlas maker.  (It only shows up if "Unity Packer" is unchecked.)

If file size is what you're worried about, you can include the atlas in your build as a raw PNG instead of as an imported texture.  The down side to this is that it uses up just as much memory as an uncompressed texture, so if memory use is what you're worried about, this won't help.

7
UICamera is doing a RaycastAll for hit detection, so overlapping colliders shouldn't affect anything there.  But if you've got a collider on an object that doesn't itself have a UIWidget, then the logic in NGUITools.CalculateRaycastDepth may be having some issues.  Or if the colliders are under different panels and you've got some really crazy depth values on the widgets…  Take a look at that method to see if it gives you any ideas.

8
NGUI 3 Support / Re: UIPanel.LateUpdate() make so high CPU
« on: July 23, 2014, 12:49:51 PM »
Caching your transforms and game objects may make a noticeable difference, too.

  1. private Transform cachedTransform;
  2. private Transform cachedTargetTransform;
  3. void Start()
  4. {
  5.     cachedTransform = transform;
  6.     cachedTargetTransform = Target.transform;
  7. }
  8. void LateUpdate()
  9. {
  10.     pos = worldCamera.WorldToViewportPoint (cachedTargetTransform.position);
  11.     …
  12.     cachedTransform.position = pos;
  13. }

9
NGUI 3 Support / Re: 3.6.6 Broke layout
« on: July 02, 2014, 12:31:55 PM »
I wish there was a way to include an "empty" UIRect that we could use to anchor widgets.

That's exactly what UIWidget does.

10
NGUI 3 Support / Re: Black textures on Android *SOLVED*
« on: June 06, 2014, 12:00:25 PM »
He might be talking about the platform-specific settings, where you can specify max texture size per platform.  Unity will resize your 4K atlas down to 2K if you tell it to, but that doesn't play well with NGUI's atlases.  The UV coordinates get all messed up.

11
Unlit - Transparent Colored has an AlphaTest in the second sub shader.  That's what's causing those warnings.

12
button.onClick.Clear();

onClick is just a List.

13
NGUI 3 Support / Re: Fat finger multitouch problems
« on: March 04, 2014, 04:45:23 PM »
Most of the cases where I've run into this involve multiple buttons in the same dialog, or somebody accidentally clicking a button with multiple fingers.  In those cases, I only want to handle the first input (if they're simultaneous, I'm fine with NGUI deciding which is the "first"), and then get rid of the dialog.  I'm not bothering with any transitions at the moment, I just destroy the GameObject.  Most of my input handlers make use of that fact by starting with a simple, if odd looking, "if (this == null)" and an early return.  You could just as easily have some state flag that gets set when you start a transition to remove the dialog, and have your event handlers check that state.

It can be a pain to have to remember to write those checks, but I'm actually with Michael on this.  If and when your game needs these restrictions, you should add it yourself.  UICamera shouldn't have to know anything about the transitions your UI is making or whether specific objects are interested in hearing about events that have occurred, because that's going to vary wildly based on the application and the developer's coding style.  You might be able to set up a flag on UIPanel that does what you want and could be checked quickly enough to not impact performance for everyone, but this seems clumsy to me.  Maybe one button should be able to receive multiple clicks, but another should only be clickable once.  (EventDelegate does allow you to add one-shot delegates, btw.)  What if I want my widgets to still respond to mouseovers during a transition but not clicks?  Or only certain widgets should respond but not others?  Or I have multiple panels in a single dialog?  There's no one right solution here, it's just one of those tedious things you have to do yourself.

14
NGUI 3 Support / Re: UIGrid or UITable ZigZag arrangement
« on: February 24, 2014, 12:17:11 PM »
With UIGrid, set arrangement to vertical and max per line to 2?  I don't see anything in UITable for this, though.

15
NGUI 3 Support / Re: Elegant way for auto-adjusting box collider on button
« on: February 20, 2014, 08:01:02 PM »
With recent versions of NGUI, I've been putting my background sprite on the same object as the UIButton (and often a UIImageButton on there as well).  The label text or any other contents are still children like they used to be.  The background sprite then adjusts the collider to fit.  This should work pretty well for most cases, unless you have an oddly shaped button or contents that extend outside of the background.

Pages: [1] 2 3 ... 6