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

Pages: [1] 2
1
Other Packages / Re: Tasharen Fog of War
« on: December 03, 2015, 11:09:22 AM »
Any plans to upgrade this to Unity 5?  I noticed in this thread that you indicated that there was a shader issue with Unity 5 earlier.

John

2
I purchased NGUI from the Asset store, and would not like to upgrade to the version that includes the source code repository access.  How do I go about doing that?

Thanks,
John

3
NGUI 3 Support / Re: Guide: NGUI and cInput2
« on: February 06, 2014, 11:28:58 AM »
... Unless you conditional compile it, at least then the change would be in a single location ie, uncommenting a #define.

We use that type of implementation frequently when integrating with external libraries to keep things easily merged together.

4
NGUI 3 Support / Re: Guide: NGUI and cInput2
« on: February 05, 2014, 01:33:37 AM »
Any chance we can get this as a configuration setting option in NGUI so that we do not have to keep dealing with merging code every time there is a new version of NGUI?

5
NGUI 3 Support / Caught in an infinite loop tonight
« on: January 19, 2014, 12:08:15 AM »
I removed the Input Axis Horizontal (prior to using NGUI) because my game doesn't use it.  Now, with NGUI, I get stuck where there is an infinite loop.

I'll go back and fix my input to include it, but this appears to be something that should be corrected to log an error and not hang up.

6
Other Packages / Re: NGUI: HUD Text
« on: January 09, 2014, 08:12:35 PM »
  "You need to use NGUITools.AddChild(parent, prefab) to create children under your UI hierarchy"

The panel that was large was one I created inside the Unity Editor (not from code) :-).

It looks like the only remaining issue I have is the turning off of the sliders now. 

7
NGUI 3 Support / Re: Can't resize UIWidget when anchor type is unified.
« on: January 09, 2014, 04:36:39 PM »
You can.

8 clicks + memory vs. 2 clicks. :-)  Just seems like a pretty common task, I know I do this a lot while tweaking things... seems like it would be a timesaver.

8
NGUI 3 Support / Re: Can't resize UIWidget when anchor type is unified.
« on: January 09, 2014, 02:27:15 PM »
Feature Request:  Have the ability to lock/unlock the anchors to allow rescaling.

I see this as unlock the anchor, but keep the orientation
adjust the widget
relock the anchor, which would recalculate the offsets.

9
NGUI 3 Support / Re: NGUITools.SetActive issue
« on: January 09, 2014, 12:39:44 PM »
I've been having issues with SetActive as well, I posed a description of what I was seeing with the other HudText related questions and issues.  In short, I could not get SetActive to enable/disable a UISlider after it was added dynamically to a HUD in game as part of a prefab that has multiple things that can be turned on/off.

10
Other Packages / Re: NGUI: HUD Text
« on: January 09, 2014, 03:40:31 AM »
Using the code above, I am unable to turn off the display of the vital bar.

I have tried setactive(false) and NGUITools.SetActive(gameobject,false) on the Gameobject "Health Vital Bar".

Even disabling it in the prefab has it displayed when it is instantiated, although oddly enough the label inside where the Percentage would be shown is not affected (ie, it is not shown).

How in the world do you turn this off?  I have had the same problem on several other objects as well where they do not "obey" and cannot be disabled.

11
Other Packages / Re: NGUI: HUD Text
« on: January 09, 2014, 02:43:07 AM »
OK, I hate it when that happens... As it turns out the Enemy HUD UI Root object had a size of 240x240x240; Interesting since it was a created as an empty game object and then dragged onto the UIRoot.

The next question I have is should the Enemy HUD UI Root object be a panel, or should it just be a GameObject, I know the examples showed the you had multiple panels in the scenes, but without the panel it appears to work... what is the benefit of an additional panel?  I do have a Player HUD displayed in the game as well as these dynamic ones.

Thanks for taking a look, if nothing else, maybe someone will find the example and the post helpful.  :)

12
Other Packages / Re: NGUI: HUD Text
« on: January 09, 2014, 02:18:40 AM »
I think I am close.. but.  The text that shows up in the HUD Text is just huge.  I have 1.9 of HudText, and the 3.0.8 (latest download as of today).

I basically have a script that creates the Enemy Hud object from a prefab, and adds it to the Enemy HUD UI Root (Screen shots attached of the prefab contents.  The problem I have is that the text is just too big, and the UIFollow does follow the cube in the scene, but it is sluggish in its following.

The cube's HUD object (also included via a screen shot) basically includes the HUDTextTest.cs script that locates the cameras and connects up to the various objects after creating the prefab and adding it to the node in the UI tree.  They it starts a background coroutine to just pump a text message into the HudText object, and tweaks the value of the vital bar.  (FWIW, I get the cameras this way because when I add the oculus rift to what I am doing, I end up with extra cameras and was having a great deal of difficulty making sure I capture the correct one.  This script has not been optimized to pool the HUD objects and cache the retrieved cameras.

Everything else appears to work, any ideas what's wrong with the text size?

13
I create a grid with no initial children.

I add children to the grid list this (pardon the naming convention, I do a LOT of C++ code, so I try to keep things named consistently everywhere because otherwise it is too hard to manage all of the codebases (2+ million lines of code)

    public void Refresh()
    {
      string[] arrstrCharacterNames = new string[] {"John", "Johnny" };


      Transform oGridTransform = GlobalUtilities.FindChild("Grid", this.transform);
      UIGrid oGrid = oGridTransform.GetComponent<UIGrid>();

      //-- Remove any existing children...
      RemoveGridItems();

      //-- Iterate through the retrieved available character names for this User...
      foreach(string strCharacterName in arrstrCharacterNames)
      {
        //-- Create a button and add it to the grid containing the list of characters...
        GameObject oChild = NGUITools.AddChild(oGridTransform.gameObject, this.PlayerNameButton);
        SelectCharacterNameButton oChildSettings = oChild.GetComponent<SelectCharacterNameButton>();

        //-- Once the button has been added, set the character name accordingly...
        oChildSettings.CharacterName = strCharacterName;
      }

      //-- We are done adding the character names, have the grid reposition the items as needed...
      oGrid.Reposition();
    }

That works; I close the "window" by deactivating it, when I do, I also remove the children from the grid like this:

    private void RemoveGridItems()
    {
      Transform oGridTransform = GlobalUtilities.FindChild("Grid", this.transform);
      UIGrid oGrid = oGridTransform.GetComponent<UIGrid>();

      //-- Remove any existing children...
      List<Transform> lstChildren = new List<Transform>();
      foreach (Transform oChild in oGridTransform)
      {
        lstChildren.Add(oChild);
      }
      oGridTransform.DetachChildren();
      foreach (Transform oTransform in lstChildren)
      {
        oTransform.gameObject.SetActive(false);
        DestroyImmediate(oTransform.gameObject);
      }

      oGrid.Reposition();
    }

Looking in the scene, I can see the items are gone.

I re-activate the "window", and add buttons (using the same code); except now, the buttons are overlapped.  The two buttons appear as children and using the inspector everything looks ok.

Any idea how to correct this?


14
Surely there must be an easier way than this to delete all of the items in a UIGrid?

      Transform oGridTransform = this.FindChild("Grid", this.transform);
      UIGrid oGrid = oGridTransform.GetComponent<UIGrid>();

      //-- First, iterate through the grid, and remove any children that are present...
      List<Transform> lstChildren = new List<Transform>();
      foreach(Transform oChild in oGridTransform)
      {
        lstChildren.Add(oChild);
      }
      oGridTransform.DetachChildren();
      foreach(Transform oTransform in lstChildren)
      {
        oTransform.gameObject.SetActive(false);
        DestroyImmediate(oTransform.gameObject);
      }

What am I missing?

Why isn't there an NGUITools.RemoveChild()?

15
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: January 05, 2014, 06:23:12 AM »
Something else that would be helpful is an event when a component becomes visible.  either OnVisibilityChanged(bool isVisible) or OnActive(bool isActive).  This would allow components to trigger things like data load or refresh when the get hidden or shown.

Pages: [1] 2