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

Pages: 1 [2] 3 4 ... 6
16
NGUI 3 Support / Re: Problem with dynamic fonts and source control
« on: January 16, 2014, 11:23:56 PM »
If you PM me your email, I will send it to you directly if you want. I feel that this is a Unity bug somehow triggered by the state of the scroll bar...

17
NGUI 3 Support / Re: Problem with dynamic fonts and source control
« on: January 16, 2014, 11:23:15 PM »
On the repro project, delete the scroll bar and it magically just works...

18
NGUI 3 Support / Re: Problem with dynamic fonts and source control
« on: January 16, 2014, 11:10:16 PM »
Quote
I don't work at Unity anymore, I left at the end of November to pursue my own interests.
I really wish you all the best with this!
Quote
I'd recommend doing a repro case without NGUI in it though. When Unity guys see "NGUI", or some other plugin, they just usually blame the plugin.
I can't reproduce this without NGUI present... I have spent a considerable amount of time trying. When the scroll bar is present it breaks, when its not, it works fine...

19
NGUI 3 Support / Re: Problem with dynamic fonts and source control
« on: January 16, 2014, 11:58:52 AM »
Meta files are committed to the git repository so that the 'Library' folder can be rebuilt. I have narrowed this down to a bug with either Unity or the scroll bar class and have submitted a bug report to Unity (Case 585890).

http://www.youtube.com/watch?v=J2GBJ4IV7bs

Please let me know if you would like me to send you the repro project directly. Though I guess that you should be able to access the case details directly.

20
NGUI 3 Support / Problem with dynamic fonts and source control
« on: January 15, 2014, 12:03:54 AM »
Hey guys

I am using GIT for my project and have configured it as follows:

- Using "Visible Meta Files"
- "Force Text"
- .gitignore excludes the "Library" folder.

The Problem:

When pulling repo from remote onto another computer, any references to dynamic fonts in prefabs are lost.

Workaround:

1. Pull from remote (into fresh folder).
2. Verify GIT shows no working changes.
3. Open Unity.
4. Wait for assets to import.
5. Notice that some of the affected prefabs show up in GIT as modified where font guid references have been erased. Not all affected prefabs are listed.
6. Reset these changes.
7. Those which were listed are now temporarily fixed.
8. For other affected prefabs:
... a) Select prefab.
... b) Temporarily change value of a field.
... c) Select "File | Save Project".
... d) Restore value of field.
... e) Select "File | Save Project".
9. Reset any working changes in GIT.
10. Fixed... until next time

This feels like a bug in Unity... but is there anything I am doing wrong?

21
NGUI 3 Support / Re: Workaround for flickering animation!
« on: January 07, 2014, 11:50:13 AM »
There are two problems with this:

1. The fix only seems to work the very first time the GUI is shown. There needs to be a script in place to reset the alpha value back to zero.

2. Becomes tricky to maintain in-editor since it becomes necessary to temporarily restore the alpha to 100% in order to adjust and maintain the GUI.

22
NGUI 3 Support / Re: Workaround for flickering animation!
« on: January 07, 2014, 03:33:17 AM »
Okay, I have found a workaround for my project, but this is definitely a bug.

Instead of animating the alpha using the animation window, I have replaced the "AnimatedAlpha" component with the following custom component. This does not exhibit the ghastly flicker:

  1. using UnityEngine;
  2.  
  3. public class AnimatedAlphaAutoReset : MonoBehaviour {
  4.  
  5.         public float startAlpha = 1f;
  6.         public float finishAlpha = 1f;
  7.         public float duration = 0.2f;
  8.  
  9.         private UIWidget _widget;
  10.         private UIPanel _panel;
  11.  
  12.         private bool _hasInit;
  13.         private float _elapsed;
  14.  
  15.         private void OnEnable() {
  16.                 if (!_hasInit) {
  17.                         _hasInit = true;
  18.                         _widget = GetComponent<UIWidget>();
  19.                         _panel = GetComponent<UIPanel>();
  20.                 }
  21.  
  22.                 _elapsed = 0f;
  23.  
  24.                 SetAlpha(startAlpha);
  25.         }
  26.  
  27.         private void Update() {
  28.                 _elapsed = Mathf.Min(duration, _elapsed + Time.deltaTime);
  29.  
  30.                 float progress = _elapsed / duration;
  31.                 float alphaRange = finishAlpha - startAlpha;
  32.                 SetAlpha(startAlpha + alphaRange * progress);
  33.         }
  34.  
  35.         private void SetAlpha(float value) {
  36.                 if (_widget != null)
  37.                         _widget.alpha = value;
  38.                 if (_panel != null)
  39.                         _panel.alpha = value;
  40.         }
  41.  
  42. }
  43.  

23
NGUI 3 Support / Re: Workaround for flickering animation!
« on: January 07, 2014, 02:36:47 AM »
Since the latest asset store release of NGUI 3.0.8f5 this workaround no longer works.

Given an animation which smoothly fades the colour (using the "Animated Color" component) the following happens:

- Enable game object to trigger animation.
- NGUI components appear for a brief instance.
- First frame of animation sets alpha to 0, NGUI components gone again.
- NGUI components smoothly fade in.

There is a brief instance at the start of the animation where the NGUI components appear, then disappear.

To reproduce:

1. Create an animation to some parent game object using the animation window.
2. Set alpha to 0 in first frame of animation and 1 in last frame.
3. Trigger animation upon enabling the parent game object during game.
4. Experience flicker.

Flicker does not occur when playing animation using the animation window's play button. The flicker only occurs when enabling the game object to trigger playback of the animation.

Any ideas for a workaround?

24
NGUI 3 Support / Re: Advice with custom list generator
« on: January 06, 2014, 08:43:17 PM »
Thanks for the advice, I have this working lovely :D

`widget.SetAnchor` wasn't quite specific enough, so I went with the following instead:
  1. widget.leftAnchor.target = cachedTransform;
  2. widget.leftAnchor.Set(0f, 0f);
  3. widget.rightAnchor.target = cachedTransform;
  4. widget.rightAnchor.Set(1f, 0f);
  5.  
  6. widget.ResetAnchors();
  7. widget.UpdateAnchors();
  8.  

25
NGUI 3 Support / Advice with custom list generator
« on: January 06, 2014, 01:36:09 PM »
I need to create a custom generator which produces a listing of items by instantiating various template prefabs. Each template will be some sort of widget container.

Instantiated widgets should be automatically anchored to the left and right of the listing generator. The items need to be stacked in the same order that they are generated. The item templates are of varying heights.

What is the best way to go about this?

26
NGUI 3 Support / Re: How to create a draggable panel in NGUI 3.0.7?
« on: December 20, 2013, 05:20:31 PM »
Never mind, the scroll view + drag scroll view seems to do the trick :)

27
NGUI 3 Support / How to create a draggable panel in NGUI 3.0.7?
« on: December 20, 2013, 04:26:01 PM »
I am unable to find the "Draggable Panel" class which I am fairly certain I used in the past. Has this been removed in favour of something new?

Here are the draggable behaviour classes which are appearing for me:

28
NGUI 3 Support / Workaround for flickering animation!
« on: December 14, 2013, 07:32:49 PM »
Hey all

I have an NGUI window with an animation which plays each time the window is shown. I am essentially animating the alpha colour of two sprite objects. Whilst this looks great I was experiencing a rapid flicker for a split second at the start of the animation.

It seems that this was caused because upon enabling my window object, NGUI updates its mesh representation of the window from its last known state, then the animation kicks in and tweaks the values, then NGUI re-updates to the new known state.

So I thought I would share my workaround should anybody else need to know:
  • Insert a keyframe at the very start of your animation for each widget which experiences some sort of flicker (or for some shared root object) to deactivate the game object.
  • In the next animation frame, setup the initial alpha colour. The widgets are deactivated, so no flicker will occur whilst making this change.
  • In the next keyframe re-activate the game objects again.
The above steps remove he unsightly flicker simply by introducing two keyframes which elapse almost instantly.

I hope that this helps future readers :)

29
I think the new anchor system is far easier; the prior was really tricky to setup!!

The nice thing with the new approach... if it automatically anchors to the wrong thing, it will automatically recalculate the offset values when you change the anchor target. That is such a wonderful feature which saves a lot of time and effort.

I think it would be nice if the UI was perhaps a little more visual... but I must admit, I am rather fond of this new system :D

30
NGUI 3 Support / Re: Animation seems to skip to end on iPad1
« on: December 13, 2013, 10:54:50 AM »
I have changed to using the legacy animation component and this resolves the issue for me. I am sure that this should work with the new system, but it doesn't.

Steps I performed to resolve this:
  • Remove "Animator" component from game object.
  • Add "Animation" component to game object.
  • Associated recorded animation which was originally used with animation controller.
  • Selected animation asset using the project window.
  • Put the inspector into "Debug" mode.
  • Changed the animation type from "2" to "1" (legacy mode).
  • Put the inspector back into "Normal" mode.
  • Fixed.

Pages: 1 [2] 3 4 ... 6