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

Pages: [1] 2
1
NGUI 3 Support / Re: NGUI 3.6.1-3.6.2 depth issue
« on: June 03, 2014, 09:28:23 AM »
I posted it wrong, the drag area is actually outside. I had to disable it completely (losing that functionality of course) to make my grid able to work again.

If you get to find something about this, I'm interested. Seems like a bug with 2D colliders and clipping panels.

Thanks for support!

2
NGUI 3 Support / Re: Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« on: June 02, 2014, 04:49:43 AM »
I think I'm having the same issue.
I've reported it here.

As Simie says it does happen only when Soft Clipping. I have to say that with the exactly same configuration it was working last week. Might sound like black magic, but today is just not responding. No change AFAIK (maybe some ExecuteInEditMode or similar is caching and serializing stuff not properly at editor time, sometimes?)

3
NGUI 3 Support / NGUI 3.6.1-3.6.2 depth issue
« on: June 02, 2014, 04:41:42 AM »
Hi there,

I have a scroll view with a grid inside. My hierarchy looks as follows:

  • Scroll View
    • Grid
      • Row 1 (collider)
      • Row 2 (collider)
      • Row 3 (collider)
  • Drag Area (collider)

Every collider is a box collider 2D (trigger). The "Drag Area" has a widget at depth 5, and a drag scroll view.
Rows are at depth 7.
The scroll view has a panel, with depth 2 (the only panel at that depth, and the topmost). Only the "cull" option is active on that panel. All the widgets have anchors to other objects, executing at OnEnable.

When I enable debugging with UICamera, it tells me it's colliding with Drag Area, but I thought the object to be hit is the one with the highest depth.

Last week I had this working properly, but today I've opened Unity again and it wasn't working.
I've updated to 3.6.2 with no success. I'm running Unity3D 4.5.0f6 on MacOSX 10.9.3.

4
Other Packages / Re: Tasharen Fog of War
« on: October 27, 2013, 01:49:53 PM »
I'm trying to use the FoW for a tile based game, so I need it to be really precise. I've modded it a little to allow point filtering mode, and adjusted texture size to fit tile size. All the objects are snapped to a 2 unity units size grid (the revealer too). See attached image to see current result.

However, I don't see the line of sight being coherent. Am I missing some setting? If not, how could I edit the algorithm (probably the RevealUsingLOS method) to improve it and fit?

5
I've been trying to update a UISlider (progress bar) on a DontDestroyOnLoad object that persists a scene load made via LoadLevelAsync. The thing is that I don't see the progress bar updating. Is possible to do that?

6
Hello,

Please consider the attached image. What you are seeing here is a custom editor tool to define objects in a war game.

These objects have several levels, each of them with a different 2D preview graphic. Using a texture field, the designer can drag and drop the images from the project inspector itself. We are trying to use a UISprite property, instead.

The thing is: we would need it to behave the same as the UISprite class; with both the atlas selector and the image selector. Do you guys see an elegant way to achieve this?

Thanks in advance for any contribution.

7
NGUI 3 Support / Re: Depth issues using colliders
« on: March 05, 2013, 09:46:05 AM »
Shame on us. Reading the FAQ, we found a way to make it work.

8
NGUI 3 Support / Re: Crash on iOS on UIPanel
« on: March 05, 2013, 06:31:58 AM »
It was a problem of dynamically switching atlasses (to support several resolutions: SD, HD & Ultra). Somehow it screwed things up. Here's the code we were using:

  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. /// <summary>
  6. /// Atlas changer dependant on the device's resolution.
  7. /// </summary>
  8. /// <description>
  9. /// This is a script that changes the reference atlas in the UI to any of the
  10. /// other atlasses based on the device's resolution, so that the pixel
  11. /// perfectness is not lost.
  12. /// </description>
  13. /// <remarks>
  14. /// This script is meant to be attached to the UIRoot object.
  15. /// </remarks>
  16. public class ResolutionSetup : MonoBehaviour
  17. {
  18.         private UIRoot uiRoot;
  19.         public UIAtlas[] usedAtlasses;
  20.         public UIAtlas[] lowResAtlasses;
  21.         public UIAtlas[] highResAtlasses;
  22.        
  23.         /// <summary>
  24.         /// Awake this instance.
  25.         /// </summary>
  26.         private void Awake()
  27.         {
  28.                 uiRoot = this.GetComponent<UIRoot>();
  29.                
  30.                 if (lowResAtlasses.Length != highResAtlasses.Length)
  31.                 {
  32.                         Debug.LogWarning("Low and high res atlasses do not fit");
  33.                         return;
  34.                 }
  35.  
  36.                 if (DeviceHelper.IsHighRes())
  37.                 {
  38.                         // Handle high res atlas
  39.                         for (int i = 0; i < usedAtlasses.Length; i++)
  40.                         {
  41.                                 usedAtlasses[i].replacement = highResAtlasses[i];
  42.                         }
  43.                 }
  44.                 else
  45.                 {
  46.                         // Handle low res atlas
  47.                         for (int i = 0; i < usedAtlasses.Length; i++)
  48.                         {
  49.                                 usedAtlasses[i].replacement = lowResAtlasses[i];
  50.                         }
  51.                 }
  52.         }
  53.        
  54.         /// <summary>
  55.         /// Raises the disable event.
  56.         /// </summary>
  57.         private void OnDisable()
  58.         {
  59.                 if (DeviceHelper.IsHighRes())
  60.                 {
  61.                         // Prevent replacement from sticking.
  62.                         // In low res, there is no atlas change.
  63.                         for (int i = 0; i < highResAtlasses.Length; i++)
  64.                         {
  65.                                 usedAtlasses[i].replacement = lowResAtlasses[i];
  66.                         }
  67.                 }
  68.         }
  69.  
  70.         /// <summary>
  71.         /// Start this instance.
  72.         /// </summary>
  73.         private void Start()
  74.         {
  75.                 uiRoot.manualHeight = uiRoot.minimumHeight = uiRoot.maximumHeight = DeviceHelper.Height();
  76.         }
  77. }

9
NGUI 3 Support / Depth issues using colliders
« on: March 05, 2013, 06:28:55 AM »
Hi,

This is the scenario we would like to have:
  • The interface has several buttons
  • When clicking one of the buttons, a pop-up window appears. This window covers 75% of the screen.
  • The rest of the screen should be shaded and the user should not be allowed to interact with the previous buttons until the pop-up window is closed.

The way we try to solve this situation is:
  • When the pop-up window appears, we enable a GameObject to mask everything but the pop-up window itself
  • This GameObject has a UIStretch (to cover the whole screen), a UISprite (to provide it with a transparent grey colour) and a BoxCollider (to nullify the user interaction with the rest of the scenery)
  • The depth of the elements in the screen is lower than this "mask". The depth of the "mask" is lower than that of the pop-up window (and its elements)

The problems we've encountered is:
  • The "mask" works with only some of the the elements in the background: when we click on each button, some of them react, some of them don't (even though all of them have the same depth). All of them should masked. What works fine is: in this situation, the buttons in the pop-up screen react when clicked
  • If we change the BoxCollider's Z coordinate, the mask makes more buttons in the background not-clickable, but (again) not all of them (I insist, even though they all have the same depth). The problem here is that the BoxCollider also masks the buttons on the pop-up window (these have higher value in depth than the mask, so they should be OVER it)

We're a bit lost here with how NGUI manages the Z coordinate through the "depth" control, and how a BoxCollider in this structure works.

Can anyone shed a bit of light so that we end up having a "normal" user interface and a mask that disables the "clicks" on those controls when a pop-up window is active?

Thank you.

10
NGUI 3 Support / Re: Crash on iOS on UIPanel
« on: March 01, 2013, 10:52:33 AM »
We have a hierarchy that expands like this:

- UIRoot
-- Camera
--- Panel
---- Panel + Managers (Parent containing shop stuff. That enables or disables children. Using NGUITools.SetActive)
----- Anchor + Collider (Window Anchor)
------ Panel + DragablePanel (Current Window. When we navigate between windows, we disable this GO and enable the corresponding window GO, and do some logic)
------- Grid + Anchor (Grid that contains the set of buttons)
-------- DragPanelContents + More Managers (Shop Button)
--------- Sprite (All the UI elements that form a Shop Button)

We're not instantiating and destroying those, just enabling/disabling.
If you need I can send you a prefab containing those objects and their settings, if that could help.

11
NGUI 3 Support / Crash on iOS on UIPanel
« on: March 01, 2013, 07:00:19 AM »
I'm getting those errors:

  1. NullReferenceException: A null value was found where an object instance was required.
  2.   at UISprite.OnFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) [0x000e9] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/UI/UISprite.cs:353
  3.   at UIWidget.UpdateGeometry (UnityEngine.Matrix4x4& worldToPanel, Boolean parentMoved, Boolean generateNormals) [0x0003b] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/Internal/UIWidget.cs:424
  4.   at UIPanel.UpdateWidgets () [0x0002c] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/UI/UIPanel.cs:834
  5.   at UIPanel.LateUpdate () [0x000be] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/UI/UIPanel.cs:969
  6.  
  1. NullReferenceException: A null value was found where an object instance was required.
  2.   at UIDrawCall.Set (.BetterList`1 verts, .BetterList`1 norms, .BetterList`1 tans, .BetterList`1 uvs, .BetterList`1 cols) [0x00283] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/Internal/UIDrawCall.cs:297
  3.   at UIPanel.Fill (UnityEngine.Material mat) [0x00133] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/UI/UIPanel.cs:927
  4.   at UIPanel.LateUpdate () [0x00101] in /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/UI/UIPanel.cs:979
  5.  
  6. (Filename: /Users/frarees/Documents/xmap-client/Assets/NGUI/Scripts/Internal/UIDrawCall.cs Line: 297)
  7.  
As a hint, I'm using NGUI 2.3.4 and HUD Root. Some UIPanels have checked the depth pass (if it helps).

EDIT: It does work on editor without a problem (long testing on this), and we get it working on some of our iPads, some of them make it crash and some others not. It's very random, but I see that it's more reproducible on iPad 4 (retina).

Any help? Thanks!

12
NGUI 3 Support / Create UI "on-the-fly" (programmatically)
« on: November 22, 2012, 04:17:12 PM »
Hi,

Is there any way to create a full GUI just from code? Every time I need to create a GUI have to do it with the UI Wizard, and I'd like to know if dynamically generating the UI is possible/factible.

Thanks!

13
Other Packages / Re: Tasharen Fog of War
« on: November 07, 2012, 05:00:01 AM »
Is this package suitable for mobile platforms?

14
NGUI 3 Support / Re: 3D NGUI objects show aliased
« on: October 10, 2012, 03:01:11 AM »
Anti-aliasing will affect performance (target: iOS). Going to change filtering and see what happens.

15
NGUI 3 Support / Re: 3D NGUI objects show aliased
« on: October 09, 2012, 09:51:46 AM »
Here you have some pictures of what I'm talking about.

Pages: [1] 2