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

Pages: [1] 2
NGUI 3 Support / Automatic UIRoot composition, how to disable it?
« on: August 15, 2014, 12:12:46 PM »

I updated to the latest NGUI and I noticed a new unexpected behaviour, NGUI now somehow tries to rearrange the hierarchy, probably to find the optimal combinations of UIRoot and Panels.

Ok I am sure currently our setup is a mess, but we cannot work on it. Is there a way to disable this automatically rearrangement?

NGUI 3 Documentation / Re: UIPanel
« on: April 15, 2014, 06:16:40 AM »
stupid question: when you say scale I assume you mean UIPanel.transform.scale. Is this the official way to change the scaling of a panel?

NGUI 3 Support / Re: Upgrade from 2.7 to 3.5
« on: March 05, 2014, 05:38:57 AM »
 :-[ bump

 I give more info, since people seem to have different issues:

- The code compiles (after our fixes)
- Monobehaviour are not missed
- GUIs are sort of working

problems are:

- not sure how to convert settings from the old NGUI to the new one. Some time the GUIs just look weird and checking every single issue is time consuming
- a lot of little issues and work through them (time consuming)

Now, if this is what we need to do, i.e.: checking every single GUI, fair enough, we need to spend a week on it. I just want to know if there is a way to make this process smoother.

NGUI 3 Support / Upgrade from 2.7 to 3.5 - it's a mess
« on: March 04, 2014, 01:35:32 PM »

upgrading the project is resulting very painful. I wonder if this upgrade tool would actually help us, we did not try yet. Please advise.

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 25, 2012, 06:13:15 AM »
should not NGUI warn me about it? Or it does already?

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 22, 2012, 05:15:51 AM »
I don't know, I mean how can I control the window size while editing? It can be anything.
While for the UIAnchor, yes it is true that we use to put many in the hierarchy. How come it is not a good practice?

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 21, 2012, 09:25:00 AM »
So this is a new update, I am not done yet though:

I can confirm that the code in UIAnchor.cs:

  1.         if (mTrans.position != v) mTrans.position = v;

should be changed in something similar to:

  1.         if ((mTrans.position - v).sqrMagnitude > 1E-08f)
  2.                 mTrans.position = v;

or even something like
  2. Vector3 ps = mTrans.position;
  4.                 // Wrapped in an 'if' so the scene doesn't get marked as 'edited' every frame
  5.                         if (!Mathf.Approximately(ps.x, v.x) ||
  6.                                 !Mathf.Approximately(ps.y, v.y) ||
  7.                                 !Mathf.Approximately(ps.z, v.z))
  8.                                 mTrans.position = v;
that you already used elsewhere.

this at least stop the scenes to be modified continuously.

However I noticed another very annoying inconvenient, many (too many to be fixed by me) scripts use to change serialized values inside Start, Awake or OnEnable. This make the scene be modified (the star appears) once I stop the game execution from the editor.
I noticed that occasionally a check to avoid to assign the same value again is present, while other times it is not.

Anyway the question is: does this introduce major troubles? If as I suspect this behavior break the prefab connections, this could be a major problem. My next experiment will be to verify if the prefabs connections are actually broken when a serializable value changes without being applied.

Edit:incredibly Mathf.approximately is not effective enough since it seems that the error is greater than the smallest tolerance.
Edit2: do you think my problem has nothing to do with NGUI and should be found somewhere else?

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 20, 2012, 12:51:41 PM »
ok the code is faulty, first I am not sure if

mTrans.position != v

checks the reference instead of the actual xyz values, but even if it checks the actual values, there is a problem of roundness. The if is ALWAYS true because of floating point errors. The class is UIAnchor.cs, I will investigate even more.

Edit: == is overridden, so the semantic of the code is correct, but anyway the problem lies on the floating point error roundness

Edit2: something like this works already

if ((mTrans.position - v).sqrMagnitude > 0.000001)
  mTrans.position = v;

Edit3: another thing I just noticed is that I Run and stop, without touching anything at all, the star reappars. Tomorrow I will investigate more.

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 20, 2012, 12:45:31 PM »
sorry could you add some info? What do you mean with "checks to see if it actually changed first."?

edit: you mean this:

// Wrapped in an 'if' so the scene doesn't get marked as 'edited' every frame
if (mTrans.position != v) mTrans.position = v;

ok it is interesting, because all the investigation still lead to this class...I will double triple check

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 20, 2012, 12:43:16 PM »
yes I verified, with the following monobehaviour the star never disappears.

  1. using UnityEngine;
  2. using System.Collections;
  3. [ExecuteInEditMode]
  4. public class UpdateTest : MonoBehaviour {
  6.         // Use this for initialization
  7.         void Start () {
  9.         }
  11.         // Update is called once per frame
  12.         void Update () {
  13.                 Vector3 v3NewPos = new Vector3(0.1f, 0f, 0f);
  14.                 transform.position = v3NewPos;
  15.         }
  16. }

Now what I suspect is that if an ExecuteInEditMode is inside a Prefab, the prefab will never coincide to the original one, even if I just revert and save.

NGUI 3 Support / Re: NGUI and [ExecuteInEditMode]
« on: June 20, 2012, 12:25:00 PM »
I must find the time to test it, but don't you think that setting the value of a parameter, even without changing it, would anyway make the star appear?

NGUI 3 Support / NGUI and [ExecuteInEditMode]
« on: June 20, 2012, 04:58:34 AM »

We are having a weird problem that we are currently putting down to the [ExecuteInMode] tag of the NGUI classes.

We are extensively using NGUI inside a prefab that is shared between several levels. All the levels are assetbundled, but before to assetbundle them we extract the shared prefab using the PushAssetDependencies/PopAssetDependencies feature.

However even doing so, the prefab is always different between the scenes, like if each scene has is own copy of the original prefab. Since we are not touching it (it happens even if we just revert it and save the scene), we are guessing that allegedly NGUI keeps on changing the prefab, even if nothing is touched.

This doubt is strengthen by the fact that once we start using NGUI, the * symbol that indicates that one scene has been changed and not saved never disappear, is always there, even if we just saved the scene.

Any advice?

NGUI 3 Support / Re: NGUI using custom mouse position
« on: May 24, 2012, 11:58:30 AM »
if I got it correctly everytime the cursor is locked and unlocked it restarts from the c enter of the view, it does not remember the last position of the cursor before the lock. I wanted to avoid this, but it looks like it is not worth it, unless there is something I am missing.
Thanks for your time though!

NGUI 3 Support / Re: NGUI using custom mouse position
« on: May 24, 2012, 10:50:18 AM »
thank you, I do not like changing NGUI at all, it would be a mess to update it.
However I could just thought about the wrong solution to my problem.
I need to be able to let the player rotate the (fps-like) camera continuously and avoid it to stop when the cursor is outside the screen.
In order to do so I used a mix of Screen.lockCursor and Input.GetAxis("Mouse Y").
Now I am not sure what to do when I release the cursor, but my first idea was remember the last position and set it back once the mouse button was released. This solution is not feasible because the Input.mouseposition is readonly.
The other solution is to make the software cursor appear always at the center of the screen, this would solve all the problems, but I am not sure about it could feel like.
Do you have advices about this problem? Thank you.

NGUI 3 Support / Re: NGUI using custom mouse position
« on: May 24, 2012, 08:38:00 AM »
if there is not another solution, I would suggest to use a proxy interface to get the current Input position, so it would be very easy for me to change just the input position provider. Please advise.

Pages: [1] 2