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

Pages: [1] 2 3 ... 5
NGUI 3 Support / Toggle state sent at Start
« on: November 07, 2014, 06:24:08 AM »
Long time no see :)

In the UIToggle script, whenever the GameObject containing the UIToggle is activated for the first time, it will directly send the onToggleChange event, even if we did not click on the toggle.
This is great for some purpose, so that you can initialize your UI directly depending on the state etc...

But imagine that you're doing complex operations when you change a toggle, and you do not want anything to be done at Start. You only want to activate something when the user click on a toggle, not when the toggle become visible... there is no way to do that.
Well yes, I could in my own onToggleChange callback, do a boolean check to see if it's the first time it's going in this method, but if I have 50 toggles, I need 50 different booleans to manage that...

The only option I found, is to modify the UIToggle script, just doing this in the Set() method:

  1. if (EventDelegate.IsValid(onChange))
  2. {
  3.    if (!m_isFirstTimeSendingEvent)
  4.    {
  5.       EventDelegate.Execute(onChange);
  6.    }
  9.    m_isFirstTimeSendingEvent = false;
  10. }

The thing is, next time I update NGUI... my code will be removed.
Do you have a solution for this?


TNet 3 Support / UDP multicasting
« on: July 15, 2014, 07:29:13 AM »


In release notes for 1.9.6, there is :"TNet will now use UDP multicasting instead of broadcasting by default."

According to the documentation in the code (in TNUdpProtocol, it's better to use multicasting).
Do you suggest using multicasting for LAN games?

TNet 3 Support / OnPlayerSync not working?
« on: July 11, 2014, 10:31:57 AM »

I've just tried to use the TNManager.playerData with DataNode to synchronise some player data. It's perfectly working, but the issue is that in the release notes, you said: "if you wish to be notified, assign a delegate to TManager.client.onPlayerSync: TNManager.client.onPlayerSync += YourListener;"

The thing is that this callback is never sent. I've checked the packages, it's sent (it goes through the send method), but is never received.
Also it's kind of "annoying" to use += etc for this, because all other TNet callbacks are just accessible via simples methods like OnNetworkPlayerRenamed, can't we do that for OnNetworkPlayerSync?


NGUI 3 Support / UITable Horizontal?
« on: May 29, 2014, 03:15:47 AM »

Is there a particular reason there is no horizontal direction mode for UITable?

TNet 3 Support / tno.Send VS tno.BroadcastToLAN
« on: May 26, 2014, 10:42:24 AM »

Can you tell me what's the difference between these two?


NGUI 3 Support / Issue with NGUI 3.5.9
« on: May 15, 2014, 08:33:06 AM »
In UIDrawCall.cs line 292 there is:
  1. #if !UNITY_3_5
  2.         string[] keywords = mMaterial.shaderKeywords;
  3.         for (int i = 0; i < keywords.Length; ++i)
  4.                 mDynamicMat.EnableKeyword(keywords[i]);
  5. #endif

But EnableKeyword is not available in Unity 4.1.2 so there's an error.
Of course if you don't want to support 4.1.2 that's your choice, but on Twitter you said you would drop support in the NEXT release, not this one :)
I have removed these lines for now.

TNet 3 Support / Calling StartUDP multiple times
« on: May 14, 2014, 12:10:40 PM »
Okay, this is totally my fault, I had an issue with TNet, but this was because I called TNManager.StartUDP once, and call it again after some specific action.
Shouldn't you add something like, check if udp has already been started and if that's the cased, return false (instead of true) ?

TNet 3 Support / Issue with serialization over RFC?
« on: May 12, 2014, 05:32:10 PM »
I'm trying to send a custom class via a broadcast, and get it via a RFC method.

Here is the class:
  1. [Serializable]
  2. public class GameData : IBinarySerializable
  3. {
  4.         public int id { get; private set; }
  5.         public string name { get; private set; }
  6.         public string spriteName { get; private set; }
  7.         public int hostID;
  9.         public GameData(int id, string name, string spriteName)
  10.         {
  11.        = id;
  12.        = name;
  13.                 this.spriteName = spriteName;
  15.                 hostID = int.MinValue;
  16.         }
  18.         public void Serialize(BinaryWriter writer)
  19.         {
  20.                 writer.Write(id);
  21.                 writer.Write(name);
  22.                 writer.Write(spriteName);
  23.                 writer.Write(hostID);
  24.         }
  26.         public void Deserialize(BinaryReader reader)
  27.         {
  28.                 id = reader.ReadInt();
  29.                 name = reader.ReadString();
  30.                 spriteName = reader.ReadString();
  31.                 hostID = reader.ReadInt();
  32.         }
  33. }

and in an empty scene, with just the following script attached to the camera (and a TNObject with ID 1):
  1. public class Test2 : TNBehaviour
  2. {
  3.         void Start ()
  4.         {
  5.                 Debug.Log(TNManager.StartUDP(12345));
  6.         }
  8.         void Update ()
  9.         {
  10.                 if (Input.GetKeyDown(KeyCode.S))
  11.                 {
  12.                         GameData gameData = new GameData(5, "Hello", "World");
  13.                         gameData.hostID = 25;
  14.                         tno.BroadcastToLAN(12345, "OnGameCreatedRFC", gameData);
  15.                 }
  16.         }
  18.         [RFC]
  19.         void OnGameCreatedRFC(GameData gameData)
  20.         {
  21.                 Debug.Log(gameData);
  22.         }
  23. }

Calling Debug.Log(gameData) return null.

Any idea why?

TNet 3 Support / LAN Server with no public IP access
« on: May 11, 2014, 10:16:43 AM »

I just saw that "- FIX: Non-windows platforms should now be able to properly join LAN servers on LANs that have no public IP access." on the release notes for 1.7.0.
Can you explain what it is?

I'm making a LAN game and don't really understand what was the issue before.


TNet 3 Support / Detect if we're a server
« on: May 11, 2014, 10:08:53 AM »
Updating TNet from 1.6.8 to 1.8.5, I saw that in a script you replaced TNManager.isHosting with tno.isMine.
What should I use to detect if a user is the host of others (I'm on making a game using LAN).


TNet 3 Support / Channel List callback?
« on: May 10, 2014, 05:56:03 PM »
Hello !

In the FAQ you already show how to retrieve a list of channels from the server in "Q: How to retrieve a list of channels from the server?".

But what if I need a callback, every time a channel is opened or closed.

Is this something you could add to TNet or should I implement my own (and how would I do that?).
Also, what I can do is send a request to have the list of channels every 5seconds. But that's kinda ugly...

NGUI 3 Support / Some widgets disappear in a Windows build
« on: February 19, 2014, 04:28:18 PM »

I'm hitting my face against the wall for several hours now on this...
I don't understand why, but in the Unity Editor, everything works fine, but when making a Windows build and launching it, I have all my dymanic labels that do not show on screen... if I replace all my dynamic labels with Bitmap fonts, I have 2-3 sprites that do not show on screen but all the labels do...

I must also precise that launching our .exe in DirectX does not have any issue, but we need to be using OpenGL -force-opengl and we have these issues using OpenGL...

Do you have ANY idea of what's going on?

Thanks in advance...

NGUI 3 Support / Error in NGUI 3.0.9 f7
« on: January 29, 2014, 10:18:10 AM »

I've just updated to the latest version (NGUI 3.0.9 f7), and I have an error in my project.
Assets/External Modules/NGUI/Scripts/Internal/ActiveAnimation.cs(112,35): error CS1061: Type `UnityEngine.Animator' does not contain a definition for `Play' and no extension method `Play' of type `UnityEngine.Animator' could be found (are you missing a using directive or an assembly reference?)

I'm using Unity 4.1.2f1, and maybe it's not available in this version?


NGUI 3 Support / Label resize broken?
« on: December 31, 2013, 10:35:49 AM »
It looks like there's an issue with label resize as you can see in the "screenshot".
If i use a font size of 26, the label do not resize an go beyond its anchors.

NGUI 3 Support / ScrollBar issue
« on: December 31, 2013, 04:50:17 AM »

I have an issue with a list using scrollbar.
If I start the scene with GameObjects active everything works fine, but if everything is disabled at start, and I activate them using NGUITools.SetActive, the scrollbar is dark and not working.

Any idea of what's happening?

Here's a small video that shows the issue.

PS : The issue is only happening if my UIScrollView has scrollbars as "OnlyIfNeeded".
PS 2 : Even if after adding items to the scrollview via script, I call : UpdateScrollbars the scrollbars remain dark, but if I drag the list the scrollbar will move (but I can't drag the scrollbar itself).

Pages: [1] 2 3 ... 5