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

Pages: [1] 2 3 ... 7
1
You are changing the transform's parent, but never notify the NGUI that this happened.

Use NGUITools.MarkParentAsChanged(gameObject)

I called  NGUITools.MarkParentAsChanged(go);  already in my second function.

2
https://youtu.be/u5afNmQtwkI

So like above video, below's cards does not shown. Until I click with mouse left inside that scrollview area.

How can I make it shown at first without the need of mouse click?

Here is code.
  1. public void MakeBattleHand()
  2.     {       //Make user's hand's card when battle mode
  3.         foreach (CardBase cd in HandCardClass)
  4.         {
  5.             AddCardToBattleHand(cd);
  6.         }
  7.     }
  8.     public void AddCardToBattleHand(CardBase cd)
  9.     {
  10.         GameObject go = Instantiate(cardPref);
  11.         AdvenUI.Instance.MoveObjToNGUITransform(go, handGridBat);
  12.         go.GetComponent<CardPreScript>().thisCard = cd;
  13.         go.name = cd.name;
  14.         MakeCardInfo(go, cd);
  15.         handScrollBat.transform.localPosition = new Vector3(0, 0, 0);
  16.         handScrollBat.UpdateScrollbars(true);
  17.     }
  18. ............
  19. public void MoveObjToNGUITransform(GameObject go,  UIGrid grid)    
  20.     {
  21.         if (go == null)
  22.             return;
  23.         go.transform.parent = grid.transform;
  24.         go.transform.position = CardManager.Instance.Tf_UI_Root.transform.position;
  25.         go.transform.localScale = new Vector3(1f, 1f, 1f);
  26.         go.transform.localRotation = Quaternion.identity;
  27.         grid.Reposition();
  28.         grid.repositionNow = true;
  29.         grid.transform.parent.GetComponent<UIScrollView>().ResetPosition();
  30.         NGUITools.MarkParentAsChanged(go);
  31.         grid.transform.parent.localPosition = new Vector3(0, 0, 0);
  32.         SetCard.Instance.ShowDeckNum();
  33.     }
  34.  
  35.  



3
NGUI 3 Support / Re: nGUI drag & drop problem after update
« on: June 10, 2017, 12:23:33 AM »
nevermind, so it was because UI-Root gameobject's transform position's  X angle was set to 90 degree.

I set this because to make battle camera shoot character from slightly at an angle from the top.

4
NGUI 3 Support / Re: nGUI drag & drop problem after update
« on: June 10, 2017, 12:16:02 AM »
Normal upgrade process is to delete the old version of the plugin before importing a new one, otherwise it overwrites the content of files, but won't rename them -- which is why you see the old file name with the new file's contents.

So I met this problem again.

I deleted NGUI folder and import from asset store, (ver 3.11.4)

but this problem exist still. so when dragging that 2d portrait item, it should only move 2d space, but it seems move 3d world.

And I turned off other DragDropRoot, so only 1 DDRoot is active.

Why and how to fix?

Thanks.

5
NGUI 3 Support / Re: Too many vertices?
« on: May 25, 2017, 08:01:10 AM »
Here is attach of inspector image of that blue hex marker.

I don't understand well, how to start it? Split up?


6
If you are calling grid.Reposition(), there is no need to set 'repositionNow' as well. The marking of parent as changed needs to happen as soon as you change the transform's parent, not later. Also, you can just have a look at UIDragDropItem's OnDragDropRelease function, it handles everything related to changing the dragged object's parent there -- but in your case I am guessing you need far less. In short, aside from the things I mentioned above, what you're doing is fine.
  1. public void MoveObjToNGUITransform(GameObject go,  UIGrid grid)    
  2.     {
  3.         if (go == null)
  4.             return;
  5.         go.transform.parent = grid.transform;
  6.         NGUITools.MarkParentAsChanged(go);
  7.         go.transform.localScale = new Vector3(1f, 1f, 1f);
  8.         go.transform.rotation = Quaternion.identity;
  9.         grid.Reposition();
  10.         grid.transform.parent.GetComponent<UIScrollView>().ResetPosition();        
  11.         SetCard.Instance.ShowDeckNum();
  12.     }
  13.  

Thx, So I revised like above, is this fine?

7
NGUI 3 Support / Re: Too many vertices?
« on: May 19, 2017, 08:50:39 AM »
Wait, you are not even using NGUI here? Why even ask on the NGUI support forum then? I can only tell you how something like this can happen in NGUI and how to fix it, but Unity's UI is outside this forum's support scope.
Of course I am using NGUI too in this game, and in this scene.

8
"go" is small card's object that actually should move between scrollviews.

and "grid" parameter is one of 3 deck's UIGrid.

9
So my game now has 3 decks, Hand, Discard, Draw decks. And cards in game frequently move between these 3 decks.

What is good code to move one scrollview's contents to another scrollview?

I used this code, but I don't know this is proper and whether having redundant line or not.

And sometimes move many cards in once, some cards are missing and card's transform appear instantly on center of camera and then moved to another, this is also annoying thing.

-------------
  1. public void MoveObjToNGUITransform(GameObject go,  UIGrid grid)    
  2.     {
  3.         if (go == null)
  4.             return;
  5.         go.transform.parent = grid.transform;
  6.         //go.transform.position = CardManager.Instance.Tf_UI_Root.transform.position;
  7.         go.transform.localScale = new Vector3(1f, 1f, 1f);
  8.         go.transform.rotation = Quaternion.identity;
  9.         grid.Reposition();
  10.         grid.repositionNow = true;
  11.         grid.transform.parent.GetComponent<UIScrollView>().ResetPosition();
  12.         NGUITools.MarkParentAsChanged(go);
  13.         SetCard.Instance.ShowDeckNum();
  14.     }
  15.  

10
NGUI 3 Support / Re: Too many vertices?
« on: May 13, 2017, 07:50:48 PM »
That means you have way too many widgets in one panel. Check what you have underneath that panel, and why you have so many vertices. Perhaps you have a lot of labels with large amount of text, using effects such as outline?

I don't know. There is no ngui ui objects when this error appear on unity console. There is only UnityGUI objects. And blue marker is also not ngui object. Here is info of blue marker.


11
NGUI 3 Support / Re: Too many vertices?
« on: May 13, 2017, 07:34:36 PM »
And how to fix this?

12
NGUI 3 Support / Re: Too many vertices?
« on: May 13, 2017, 04:41:41 PM »
That means you have way too many widgets in one panel. Check what you have underneath that panel, and why you have so many vertices. Perhaps you have a lot of labels with large amount of text, using effects such as outline?

Thanks,

but How to identify the panel that has vertices problem?

13
NGUI 3 Support / Too many vertices?
« on: May 10, 2017, 05:22:04 AM »
I got this error when I play unity and some of my game's land's blue hex icon increased.

I think this happen when blue hex icon's coverage area become over camera's range.

Why and how to fix this error?

14
Why are you mixing two different UI systems? Stick with one. NGUI event handling has nothing to do with UGUI. You can't mix them, and you can't block one from the other.

Because current project has ngui made UI system at 2015. At that time, there was no UGUI.

And ugui still doesn't support drag & drop.

15
So I have 3d map in my game scene and 3d objects on that map.

I using tooltip trigger that trigger description ugui window if I mouse over to that 3d object's collider.

Problem is, when I open NGUI UI, when I mouse over to 3d world's object, tooltip triggered Even when NGUI UI element block it so it does not shown.

How can I block input to that ugui tooltip when NGUI UI shown over it?

Thanks.

Pages: [1] 2 3 ... 7