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

Pages: [1] 2
1
NGUI 3 Support / Re: iOS 64bit requirement, best path forward?
« on: March 05, 2015, 06:33:39 PM »
Thanks for the response bach.

Since I don't know what you're suggesting I let Unity engineers worry about, my question must not be very clear, so I'll try again.

Currently, my NGUI game runs great on Unity 4.5.  Unfortunately, if I submitted that game to Apple, it would now be rejected because it does not support 64 bit.  Last month the submission would have been fine, but now the requirement is in place.

As I understand it, there are two options to support 64 bit: upgrade to Unity 5 OR Unity 4.6.2+ AND enable IL2CPP to create a universal 32bit/64bit build.

Looking at the forums, it looks like if I choose either of those paths today, I will get a bunch of errors, mostly on the Unity side. I'm confident those errors will go away with time and updates of both Unity and NGUI.  So I'm just looking for guesses/advice as to which path is likely to clear the fastest, which is probably a function of which path is a priority for both Unity and NGUI.

2
NGUI 3 Support / iOS 64bit requirement, best path forward?
« on: March 05, 2015, 02:07:06 PM »
I know that Unity5 and IL2CPP are both new and buggy.  But since 64 bit support is now a requirement for iOS submissions, I would love advice/opinions on the better path to release a game in the next couple of months.  Would you upgrade to Unity 4.6.2 with IL2CPP or Unity 5 for your existing NGUI project?

I'm sure there will be some waiting involved in either path as both Unity and NGUI have to evolve.  So it's a judgment call based on the unknowns of the combined wait time and the required amount of rework on each path.

3
NGUI 3 Support / Re: Deleting and adding items to ScrollView - weird bug
« on: September 08, 2014, 10:38:20 AM »
Why you ask?  Two reasons: 
1. I'm a bad coder
2. I'm a lazy coder    :D

The OnEnable approach is much better so thanks for pointing me in that direction.

Since I'm still bad and lazy, I'm now also using ...  if (MyGrid.activeInHierarchy) … before calling any loops on the children of the grid like NGUITools.AddChild or NGUITools.Destroy, or calling Reposition on the grid or ResetPosition on the scrollview

Thanks again for your help!

4
NGUI 3 Support / Re: Deleting and adding items to ScrollView - weird bug
« on: September 03, 2014, 04:07:49 PM »
That's probably what I'm doing…BUT…

…I'm happy to do it another, better way if you have a suggestion

…it worked fine prior to NGUI 3.5.7 and Unity 4.5.1

…this implies we can't update content on inactive tabs at runtime which doesn't sound right

I'll try to work up a repro, but here are the basics:
   start a scene with Example 13, Tabs
   insert a scrollview from Example 7, Scroll View Panel into the content section of each Tab page
   when the scene is playing, run a script that re-populates the items in the UIGrid for each scroll view.  FYI, my usage scenario is getting the latest list of open and closed matches from the server.
   if you run the scene before switching tabs, things should work.  If you switch tabs before running the script, NGUITools.AddChild will create a phantom UIRoot/Camera, probably because you're trying to add a child to a disabled object on the hidden tab.

5
NGUI 3 Support / Re: Deleting and adding items to ScrollView - weird bug
« on: September 03, 2014, 10:32:56 AM »
Updating since I finally had a chance to update to Unity 4.5.3 so I have the latest of both Unity and NGUI.  Unfortunately, I still get the phantom UIRoot/Camera adding to my scene.

On the positive side, I have a new idea why.  I have multiple UIScrollViews in my scene.  I am also using the tab pages layout from Example 13, and have a scrollview for the content of each tab.  So the problem might be related to UIToggle and UIToggled Objects interacting with UIScrollview interacting with NGUITools.AddChild

When I launch this scene and do not change tabs, everything works.  But if I change the tabs and then access the script to refresh the content of the scrollviews (both on the active and inactive tabbed pages), I get the phantom UIRoot/Camera.  So I'm guessing trying to AddChild underneath a UIToggled object after UIToggle changes state may be the issue. 

6
NGUI 3 Support / Re: Deleting and adding items to ScrollView - weird bug
« on: August 29, 2014, 04:50:53 PM »
It looks from Aren's post that the problem is in adding, not destroying, but thanks for the hack on the destroy bit too.  Odd that you couldn't just unparent and then immediately Destroy ob.  But I'll play with it.

7
NGUI 3 Support / Re: Deleting and adding items to ScrollView - weird bug
« on: August 29, 2014, 11:23:14 AM »
I just upgraded to the latest NGUI and am getting the same issue.  And I can't tell from the thread how to solve it, so bumping.

Milox, did you get it working?

ArenMook, I am following the example in Scroll View (Panel).  So the UIPanel is attached to the ScrollView, and the instantiated UI elements are being added and destroyed underneath the UIGrid. 

ScrollView (Panel)
   UIGrid (no Panel)
      Object 1
      Object 2
      etc.

So that's probably why NGUI is now force creating new UIRoots when I use NGUITools.AddChild (UIGrid, newItem).  But how to fix???

Should we add UIPanels to the UIGrids as well?

Or is it better/possible to add/destroy the objects directly underneath ScrollView.  I'm wondering if that will mess up how UIGrid works.

8
NGUI 3 Support / Re: Refractive shader Win8
« on: August 27, 2014, 10:47:42 AM »
Shader error in 'Transparent/Refractive': 'vert': output parameter 'o' not completely initialized at line 64

When the Microsoft shader looked at it, he didn't see anything obvious, but thought there might be an issue with how the Windows platform needs "four zeros, not just two".  That's all over my head but passing along what he said.

9
NGUI 3 Support / Refractive shader Win8
« on: August 25, 2014, 03:13:53 PM »
I attended the Windows Porting Event at Unite last week and ran into one problem with NGUI.  My project UI used the basic Refractive atlas provided in the NGUI example folder and the Transparent/Refractive shader.  But the project would not compile to WinPhone8 and threw an error related to the shader. 

The helpful Microsoft staff at the porting lab could not figure out a solution, so I'm passing it along in case it can be fixed on the NGUI side.  I hope that helps.

Thanks!

10
NGUI 3 Support / Re: Disappearing box colliders
« on: July 24, 2014, 10:06:08 AM »
I've also noticed that while my UIRoot is set to 2D, my UICamera's Event Type is 3DUI, not 2DUI.  I don't see the documentation for those choices, so not sure whether that could be relevant here.  I tried switching it, but lots of stuff broke, so I switched it back.

I also do quite a bit of activating/deactivating UI elements so it would be good to confirm the most up to date way to do that.  For example, I remember there used to be NGUITools.setactive prior to Unity 4.5, but I now use UIwidget.gameobject.setactive(bool); to turn my widgets and their children on and off.  I hope that is still correct.

11
NGUI 3 Support / Re: Disappearing box colliders
« on: July 23, 2014, 09:00:13 PM »
No, I'm on NGUI 3.6.7

I guess I wasn't working on my UI when you made the switch from UIAnchor/UIStretch to anchors in UIRect.  So that's good to know.

Has working with colliders changed too?  I now see under Extras something about switching to 2D or 3D colliders.

12
NGUI 3 Support / Re: Disappearing box colliders
« on: July 23, 2014, 12:48:47 PM »
I can't think of a reason either, which is why this is weird…but true.

I tried the physics collision matrix, but no effect.  Here are some more specifics that might help figure it out.

The spinning cube is part of gameplay and not the UI, and actually doesn't spin.  My gameplay camera actually spins 90 degrees around the stationary cube when I swipe.  My NGUI camera only renders NGUI objects, and my gameplay camera only renders gameplay objects.  So to be more accurate, when I spin my gameplay camera twice, some of the NGUI element box colliders get disabled.  And interesting to note that spinning just once does not disable that same component. My UICamera Event Type is set to 3DUI, and I do NOT attach UICamera script to my main gameplay camera, only my NGUI camera.

I've also noticed that other random NGUI components get disabled during runtime, like UIStretch and UIAnchor.  All the NGUI elements look right, but those components are also getting disabled somehow during runtime.

I'm using FingerGestures as input, so maybe that input is affecting NGUI somehow, in addition to the gameplay.

And my own gameplay camera script uses a StopAllCoRoutines() call as part of the spinning process.  So if NGUI uses coroutines, maybe that's what causes the random component disablement.

13
NGUI 3 Support / Disappearing box colliders
« on: July 22, 2014, 07:46:21 PM »
I have some weird interactions happening between my NGUI objects and my gameplay objects.  For example, I can spin a cube and the box collider for one of my NGUI elements can get disabled by that spin.

So I'm guessing there is some physics based interaction that is happening where the collider of the gameplay object and the collider of the NGUI object collide in such a way as to disable the NGUI object.  So two questions…

Why/how could that happen?

How can I prevent?  Are there simple tips to keep the NGUI elements and the gameplay elements clearly separate within the scene?

14
NGUI 3 Support / Re: UIToggle and scripting
« on: June 05, 2014, 10:09:33 AM »
Thanks!  I updated for MyToggle.current.value above.  I missed that originally because "current" was not an auto-fill choice in MonoDevelop but "value" was.

I also understand why it's important to have the callback function get called during startup. 

My question is, "Do you have a recommendation on how best to handle the scenario where we don't want the saved state to fire the associated OnValueChange function?"  Or would you advise not using checkboxes in this way if this scenario is possible?

15
NGUI 3 Support / UIToggle and scripting
« on: June 04, 2014, 06:28:46 PM »
In the basic description for UIToggle, it would be great to share the best/easiest/latest way to use checkboxes to execute different scripts.

Let's take the basic options menu example.  If the user checks the box, execute the TurnOn script.  If the user, at some later point, unchecks the box, execute the TurnOff script.  And remember from game session to game session what the user selected with the UISaved Option component.

Here's my current guess as to the best answer. 

Create a method and attach it to the OnValueChange field of the UIToggle component. That method should look something like this…

       public void ChangeWithTheCheckBox () {
      //when the toggle is checked
      if (MyToggle.current.value) {
         //do this
                        TurnOn();
      }
      //when the toggle is unchecked
      else {
         //do this other thing
                        TurnOff();
      }
   }

I've noticed that UIToggle.value is better to use than the PlayerPref Key Name for that toggle since there's a race condition between the toggle notifying the script and the playerpref being updated.

The trouble with this approach is that the toggle value changes (sometimes) at scene startup, which would execute either TurnOn or TurnOff without user intent, which may not be desired.  For example, if the checkbox was for Facebook, the first time it was checked you would want to register and login, but you would not want to re login every time you loaded the options menu.

So I'm hoping there's a best practice for this common scenario.

Pages: [1] 2