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.


Topics - sfj

Pages: [1]
1
NGUI 3 Support / NGUI VR Best practices?
« on: February 06, 2017, 03:00:57 AM »
Hi,
  I'm wondering what the recommend way is for implementing ngui in VR. So far I just made a hack that parents the whole GUI on the player camera so it gets rendered with the rest of the scene, to place indicators for level objects I trace a line intersecting the GUI plane.

So it sort of works...but there are issues with the GUI becoming smaller/scaled..there are of course many ways to deal with this...but I'm was wondering if there is an "official" recommend way of working with VR gui.

My game is sort of FPS game with some stats on the hud and gui elements/indicators overlaying world space objects.

/stefan

2
NGUI 3 Support / Localisation and fonts best practices?
« on: January 12, 2017, 06:31:53 AM »
Hi Guys,
  I have decided to localise my game and I'm wondering what would be the best approach for handling fonts, previously I've used bitmap fonts generated with BMGlyph. The big issue is of course..how to handle languages like Chinese/Japanese. These languages as far as I have understood doesn't have simple alphabet either.. =O

Any recommendations on how to do this?

Cheers,

Stefan

3
Hi,
 I got a problem on Apple TV where I have a level selection map, I have changed the navigation to use "center on child" and my own code instead of "scrolling" and this works fine on iOS and in the editor.

Although when I deploy to apple TV the scrollview also starts scrolling normally even though no scrollbars are hooked up, I guess this comes from the input events...if that is the case...then I would need to disable these for this particular scroll view, is this possible?

Any ideas what is happening, how to work around this?

Cheers,


Stefan

4
NGUI 3 Support / Fast forwarding/Jump to one end of tweens.
« on: November 06, 2015, 11:42:12 AM »
I've been using tweens to fade in UIPanels/bunch of widgets and that gives a pretty simple logic for PlayForward() to show the panel/widget and PlayReverse() to hide the panel. Now in certain cases I'd wan't to skip the whole fading and jus make it visible straight away.

One way to do that would be to set the duration to "0" and then hit play, although that could get messy if one has to start restoring the "duration" for a bunch of tweeners.

Another way could be to just access the panel/widget and overwrite the alpha directly...but makes the code a little "hacky".

So Is possible to fast forward tweens directly, without messing up their attributes..or modifying the class itself...or maybe there is a better way to think about the whole thing?

Cheers

Stefan

5
NGUI 3 Support / Event Delegates and UItweener
« on: March 11, 2015, 09:57:52 AM »
Hi,
I'm having some trouble with a tween controller class where I want to fire of multiple tweens and then wait for them to finish.

So basically I'm starting a tween...building a list with the tweens that are in progress and then removing from the list when they are done...although it doesn't seem to work properly so there must be something I didn't get missed/not understand:

  1.         // Use this for initialization
  2.         void Awake ()
  3.         {
  4.                 _uiTweeners = GetComponents<UITweener> ();
  5.  
  6.                 if (_uiTweeners.Length == 0)
  7.                         _uiTweeners = GetComponentsInChildren<UITweener> ();
  8.  
  9.         }
  10.  
  11.     void Start()
  12.     {
  13.         foreach (UITweener tweener in _uiTweeners)
  14.         {
  15.             EventDelegate onFinishedDelegate= new EventDelegate();
  16.            
  17.             onFinishedDelegate.target=this;
  18.             onFinishedDelegate.methodName="TweenerFinished";
  19.             onFinishedDelegate.parameters[0].obj=tweener;
  20.  
  21.             EventDelegate.Add(tweener.onFinished, onFinishedDelegate);
  22.  
  23.         }
  24.     }
  25.  
  26.    
  27.     void TweenerFinished(UITweener sender)
  28.     {
  29.         tweensInProgress.Remove(sender);
  30.  
  31.         if (tweensInProgress.Count==0 && onFinishedCallback!=null) onFinishedCallback();
  32.     }
  33.  
  34.     public void PlayForward (Action callback)
  35.         {
  36.  
  37.         if (tweensInProgress.Count==0)
  38.         {
  39.  
  40.             onFinishedCallback=callback;
  41.  
  42.                 for (int i = 0; i < _uiTweeners.Length; i++)
  43.             {
  44.                 UITweener tweener=_uiTweeners[i];
  45.  
  46.                 tweensInProgress.Add(tweener);
  47.  
  48.                 tweener.PlayForward();
  49.                 }
  50.         }
  51.    }

Is there anything crazy there?

Stefan

6
Hi Guys,
    I'm getting this "Destroying GameObjects immediately is not permitted during physics trigger/contact or animation event callbacks...." error and haven't been able to solve it, apprently it is to do with destroying drawcalls rather than actual physics stuff...the error happens when I'm running in the editor and results in "burnt in" widgets on screen.

Player log:

! about ot do destroy immediate on : _UIDrawCall [joyMaterial]
! (error) Destroying GameObjects immediately is not permitted during physics trigger/contact or animation event callbacks. You must use Destroy instead.

What I'm doing is disabling a panel with widgests and stuff...

Here is my code:

  1.         void OnDisable()
  2.         {
  3.                                
  4.                 //Do stuff with the Panels
  5.                 foreach (GameObject _gameObject in GUIPanelGameObjects)
  6.                 {              
  7.                         if (_gameObject!=null)
  8.                         {                                                              
  9.                                 //Instead of setActiverrecusively
  10.                                 NGUITools.SetActive(_gameObject, false);
  11.                                
  12.                                 Debug.Log("Disabling panel: " + _gameObject.name);
  13.                                
  14.                                                                
  15.                         }
  16.                 }
  17.         }

What I have is a ScreenObject that represents a screen and it's required Panel(s) ( InGameWidgetsPanel,PausePanel...etc).

I use these "ScreenObjects" to control what I see on Screen by disabling/Enabling them and through that also disabling/hiding referenced ngui panels and their widgets.

Would anybody have any advice on how to solve this..?

ThanksInAdvance!

Stefan

Pages: [1]