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

Pages: [1]
1
TNet 3 Support / DontDestroyOnLoad and TNManager.Create
« on: June 18, 2014, 06:32:05 PM »
I have a few dynamic objects which persist between scenes. I am getting "Network ID ## is already in use" error messages, which appear to be caused by TNManager.LoadLevel resetting the object counter used for assigning ids. Is there a supported way of having network objects correctly surviving a scene load?

2
TNet 3 Support / TNSerializer structs
« on: June 18, 2014, 11:33:15 AM »
In the method TNSerializer.Create(this Type type) (TNSerializer.cs:259) you use reflection to get a constructor for the type provided. If this type is a struct, this doesn't seem to work.

I swapped out the entirety of that method with...

  1. Activator.CreateInstance(type);

..and everything seems to work fine for structs and classes. Was there a reason you went down the constructor reflection route instead of using Activator?

3
NGUI 3 Support / Bug: 2D UI Events Inside Clipped Panels (3.6.1)
« on: May 29, 2014, 02:16:11 PM »
When using the 2D UI event mode I found a bug where widgets inside a clipped panel had their events filtered out by the IsVisible check on the clipped panel. It was using the raycast world pos, which was 0,0,0 for some reason.

I changed line 742 of UICamera.cs from
  1. if (IsVisible(ref mHits.buffer[b]))
to
  1. if (IsVisible(lastWorldPosition, mHits[b].go))
and that fixed it.


EDIT: In fact, I'm encountering a lot of other issues with 2D colliders. One is that below a certain size the collider no longer gets hit by raycasts (I assume there is some minimum size that Unity is disabling the collider at)

4
TNet 3 Support / Networked Game Structure
« on: May 13, 2014, 08:03:22 PM »
Hi Aren,

I currently have a game which has a structure like this: (classes in bold)

- Each connected player has control of a Planet
- Each planet contains 12+ BuildingSlot gameobjects, each of which can contain a building of any type.
-- Player can trigger construction of Building gameobjects in these slots (Building is subclassed by many unique building types)
-- These buildings have their own unique properties to sync (e.g.: reload time for weapons), as well properties common to each (health, construction progress, etc)
-- Buildings may be destroyed by the actions of other players

I currently have it set up so the Planet, BuildingSlot and Building all have their own TNObject, to prevent all the building logic taking place in the root Planet object.

I've read around some previous topics in this board and it looks like you recommend against having nested TNObjects, I'm wondering how you would recommend structuring a system like this in that case. I'd like to avoid bundling all my building logic and communication in one place if possible.

Any advice would be appreciated.

Thanks!

5
NGUI 3 Support / Culling Problem (3.0.6 f5)
« on: November 28, 2013, 03:39:37 PM »
Hi again. I'm having an odd problem with some 3D UI that worked fine in versions prior to 3.0.6.

I've made videos to show the problem:
https://www.youtube.com/watch?v=9UqnYuJ_w_Y <- Shows how the NGUI meshes are culled far too early
https://www.youtube.com/watch?v=ou_stg8vjaY&feature=youtu.be <- Shows how the distance that meshes are culled at changes depending on where the meshes are in world-space.

My setup is something like this:

UnderWorld GUI Camera - Shows the rings around the outside of ships (not all of them, I'm in the process of transitioning them all over)
Main Camera
OverWorld GUI Camera - Shows the ship option hexes

It seems that in some areas of the world, the generated NGUI draw calls are seemingly culled when the camera gets too close. The camera's near clipping plane is set as low as possible (and this setup worked fine pre 3.0.6, so something has changed with NGUI to cause this).

Any ideas?

6
NGUI 3 Support / Flickering Issue
« on: November 24, 2013, 06:39:30 PM »
3.0.6 rc3

Video: https://www.youtube.com/watch?v=J_xHKkpDBw8 (Can be hard to see the flickering, since it looks like an artifact of the video itself)

Whenever a widget changes parent, or some other change occurs which causes panels to be refreshed, all the widgets on-screen will disappear for a frame or two before reappearing. This is especially noticeable on iOS, where the refresh seems to take much longer, but also occurs on standalone builds. It doesn't occur in the editor, and doesn't occur anywhere when using 3.0.5. Panel refreshes also seem faster pre-3.0.6.

I also had to manually call UIPanel.Refresh() at times, since it doesn't seem to detect changes in alpha correctly sometimes in 3.0.6. In the video above, the times Panel.Refresh() is being called are when the character cards are pressed and they begin to expand towards the centre of the screen, tweening their alpha from 0.0f -> 1.0f in process, the new alpha value doesn't seem to take effect unless I do something like this before the tween begins:

  1. ContentsPanel.alpha = 1.0f;
  2. ContentsPanel.Refresh();
  3. ContentsPanel.alpha = 0.0f;
  4.  

I can provide more detail if needed.

7
NGUI 3 Support / Disabled UIAnchor updates when window is resized
« on: November 24, 2013, 05:58:45 PM »
NGUI 3.0.6 rc3

A disabled UIAnchor will Update() when the window is resized. Bug?

8
NGUI 3 Support / UITweener.Begin, setting delay
« on: February 13, 2013, 05:07:27 PM »
When using the delay property of UITweener to animate in some buttons in order, I've encountered a slight annoyance with the Begin method's behaviour.

  1. TweenAlpha.Begin(Buttons[index].gameObject, 0.5f, 1.0f).delay = someDelay;
  2.  

OnEnable appears to be called on the UITweener before .delay is set (I put some Debug.Logs in there to check the order), so the start time is not correctly calculated. Is there a way of using the UITweener.Begin convenience methods and use the .delay property correctly?

I added an optional parameter to UITweener.Begin and TweenAlpha.Begin() for my purposes, but it'd be great to have it fully supported in the future.

EDIT: The above code works fine if there isn't already a TweenAlpha behaviour attached to the game object. I'm guessing that Start() is called the next frame so setting the delay property happens before Start() is called.

PS. I just upgraded NGUI for my project today, the new UIPanel.alpha property is a godsend. Thank you so much!

9
NGUI 3 Support / Text Glow
« on: November 29, 2012, 09:37:14 AM »
Is there any way to achieve a text glow dynamically (shaders are mentioned in the UILabel docs, but I can't find any more about that)

Here is an example of what I'd like to achieve:

Pages: [1]