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

Pages: [1]
1
NGUI 3 Support / Re: NGUI VR Best practices?
« on: February 13, 2017, 03:45:53 AM »
Thanks for the reply,
  So I'll continue on my path with he GUI attached to the camera.

I can see that making the modifications to the shader breaks clipping, are there further modifications that can be made to make it work or is it a matter of splitting the gui by material/shader?

Cheers

Stefan

2
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

3
NGUI 3 Support / Re: Localisation and fonts best practices?
« on: January 12, 2017, 03:21:29 PM »
Thanks, that sounds like a pretty pain free way to do it.

I googled around and a program called FontForge to seems to be able to merge fonts. I'm doing Japanese, the two Chinese dialects and Russian for now.

Downloaded a Chinese font but that was like 23mb, but maybe that contained more than 50 characters,
I guess it's also possible to strip out unwanted stuff..if I parse my text database for unique characters and just keep those.

Cool..I'll get busy with it..very happy that I don't have to start spitting out multiple atlases etc.. =)

Cheers

Stefan

4
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

5
The apple TV has a remote and gamepads. The remote itself has apparently been wired to work both as a controller and a touch device, that is that why it got a little funny.

I did have a look at  modifying the scroll view, or UIDragScrollView script as you suggested and that would work. The solution I picked for now, as it seems be least intrusive, was to create a little script where I can declare platform dependent UICamera input settings. This allows me to just have one GUI that works on all platforms.


 

6
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

7
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

8
NGUI 3 Support / Re: Event Delegates and UItweener
« on: March 19, 2015, 10:32:53 AM »
yeah that sounds like efficient way to do it.. so have some code that picks out the longest tween and then assign OnFinished on that one,

well I ended up simplifying my old code with just counting the tweens..I guess not as efficient as your suggestions but more than the first and hopefully less strange:

  1.         foreach (UITweener tweener in _uiTweeners)
  2.         {
  3.             tweener.SetOnFinished(() =>
  4.             {
  5.                 tweenersInProgressCount--;
  6.                 if (tweenersInProgressCount == 0 && onFinishedCallback != null)
  7.                     onFinishedCallback();
  8.             });
  9.         }

9
NGUI 3 Support / Re: Event Delegates and UItweener
« on: March 18, 2015, 06:09:16 AM »
Thanks...a totally strange way of doing it...although working now... what would be your advised way of doing it?

10
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

11
NGUI 3 Support / Re: Protection Level ??
« on: April 07, 2014, 01:30:41 PM »
I also got this today when I upgraded…I'm using unity 4.2…as far as I understand there are still a lot of issues with unity 4.3…debugging not working properly is one of them…compatibility problems with osx mavericks etc…making a lot of people stuck on 4.2 for the time being… :(

12
Fantastic it's working now, yes indeed WaitForEndOfFrame is enough...digging deeper in my code I found other things generating the same error just to make things more confusing... and these things seem to have needed a few seconds to clear, thanks for your help!   :)

13
Hi Aren, thanks for your quick reply. Is this then during a "general physics callback" in unity and not specifically related to any of the widgets in the panel that is to be disabled? ( as I tried removing all buttons with no success). 

So I created coroutine where I use the WaitforSeconds to delay things..and by setting it to as long as five I seem to getting rid of the error...although that is quite a long time in game... ???

How would you do a coroutine?

14
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]