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

Pages: [1]
NGUI 3 Support / Slider with Custom Shader
« on: August 21, 2015, 01:33:49 PM »
Attached is a screenshot from a shader I've made for a healthbar. It is a very simple shader/mesh effect, using distorted UV coords and a panner.

Is it at all possible to use such a shader and a custom mesh as a slider with the default NGUI classes? If not, what would be the best way to implement this visual effect so that it works as an NGUI widget/slider?

NGUI 3 Support / Disabling Interaction While Tweening
« on: June 02, 2015, 07:12:45 PM »
I want to use position tweens for the transitions between my panels but I want it so that player won't be able to interact with any UI element while the position tween is playing.

Does NGUI have any utility to handle that or do I disable every element's collider for example wherever I call the PlayForward() and re-enable them on OnFinished?

TNet 3 Support / Different Games on Same Lobby Server
« on: December 12, 2014, 02:34:08 PM »
I've searched but couldn't find a similar question, if it's asked before or answered anywhere else my apologies.

Is it possible to register the servers of two completely different games on the same lobby server? Or do I have to rent a new hosting for each game's remote lobby server separately?

TNet 3 Support / Possible Bug in LagPosition Script
« on: November 24, 2014, 09:54:52 AM »
There is possibly something very simple going on and I've probably fixed it with an overkill solution but here it goes.


On my player prefab, the renderer and the collider are on two separate game objects. Renderer has the LagPosition script attached. Works great, no problems regarding jittering / stuttering whatsoever.

What happens:

Player1 enters the game.
Player1 moves it's avatar.
Player2 joins the game.
In Player2's instance, Player1's avatar smoothly moves from it's spawn point to it's current position instead of appearing in it's current position.

How I fixed it

I delayed the initialization of the LagPosition script. I set the mTrans, mAbsolute and mRelative variables a couple frames later so they get the synced position of the other avatars.

So is this a bug or am I missing something? At any rate, it's working now.

TNet 3 Support / Creating Lan-Only Server
« on: November 21, 2014, 11:01:14 PM »
In my game I want the player to be able to start a server either lan-only or on the internet. I see that TNServerInstance.Start has an overloaded version which accepts an enum parameter named "Type" which happens to contain "Lan, Udp, Tcp". This overloaded version of the method also forces me to indicate a lobby port and a filename to save the server to :(.

So I have some questions regarding the above.

1) I consider if I set the server type to Type.Lan, it will only use the local ip address and won't be connectable through the external address. Am I correct about this assumption?
2) When it comes to choosing the server type between Udp and Tcp what is the determinant factor? What are the main differences and is it possible for one of them to be incompatible with the user's connection setup?
3) Since it's possible for a server to be either Udp or Tcp what is the best way to setup the TN Lobby Client components/scripts. I read that I shouldn't keep both Udp and Tcp lobby client active at the same time. Should I keep them both on my network manager gameobject and toggle them based on the type of the started server?

Any and all answers are much appreciated!

NGUI 3 Support / Changing the "value" of a disabled UIToggle problems
« on: September 17, 2014, 07:55:43 AM »

I have a tabbed interface for an in-game market. There are 4 tabs (UIToggle with same group index) each activating their respective UIScrollView. These scroll views contain their own set of UIToggle 's for the items being sold in the game. This works great with no problems.

What I want to do is; I want to select the first item of the related scroll view when the market tab changes. I want to set it's value to true. I tried two ways, both didn't work completely.

1. I programmed a method which finds the first item of the given category and set it's value to true. I invoked this method through the each category UIToggle's OnValueChange by hooking it through it's inspector. Upon testing it I realized the first item is accepted as the "activated" one after doing this because I can't select it anymore unless I select something else first. But it's animation doesn't play (The animation it should play when it's the activated UIToggle in the group). And it's own OnValueChange is never called.

2. I added a bool to the UIScrollView called "activateFirstItemOnEnable". I've also added it to the UIScrollViewEditor so I can see this bool in the inspector. What it does is, it calls my above mentioned method of finding and activating the first item in the UIScrollView 's OnEnable() if activateFirstItemOnEnable is true. This way the animation of the first item 's UIToggle plays nicely. But if I have selected -for example- item5, changed category, and came back to this category, item5 's dismiss animation doesn't play, it just stays with the "active" animation so it looks like both item1 and item5 are active at the same time. Also the item1 's OnValueChange is not called this way either (I want it because I refresh some labels containing the details of the selected item).

TL;DR So how can I make it so that when I enable a scroll view with a button, it's first UIToggle item get's selected, plays it's animation smoothly, invokes it's OnValueChanged method and disbles all other UIToggle's in the same group under this scroll view.

Hope it makes sense, thanks in advance for all the help!

Pages: [1]