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

Pages: [1]
1
NGUI 3 Documentation / Re: UICamera
« on: December 03, 2014, 07:10:51 AM »
Events go to... option isn't documented. What are there drawbacks, if any, for using "Colliders" instead of "Rigidbodies" (the default value)?

2
NGUI 3 Support / Re: How can I manually cancel drag of UIDragDropItem?
« on: November 25, 2014, 06:46:37 AM »
ExampleDragDropItem has the code inside that performs additional validation inside. You can always cancel the drag operation, returning the item back to its spot.
Yeah I saw that but it still calls base.OnDragDropRelease which is the one causing problems.
Should I copy the method's contents removing the UIDragDropContainer part to be good to go?
Seems the only way to cancel the operation as if no DropContainer wast here.

3
NGUI 3 Support / Re: How can I manually cancel drag of UIDragDropItem?
« on: November 24, 2014, 04:51:35 PM »
I'm a bit late to the party but it's super related.

Is there a "builtin" way of reverting a drag? By reverting I mean doing just the same as StopDragging but also ignore the UIDragDropContainer it may be sitting on and get back to wherever the drag started.

4
NGUI 3 Support / Texture Mask ignores UIPanel bounds?
« on: November 03, 2014, 10:34:57 AM »
Hi there,

First off let me explain what I'm trying to achieve, then I'll show my weird results and maybe you can help me.

I want to multiply this image:

Link

On top of this one:

Link

So it looks like this:

Link

This effect is quite easy to do on most image editors, but I'm gonna be using dynamicly loaded images to stamp on top of the "card shape" so doing it with NGUI would be more useful than manually for each image.

This is what I have right now:

Link

I tried creating my own version of "Unlit/Transparent Colored" shader (with an extra texture as input) but it didn't work. I can't get to work any material, even NGUI's default "Unlit/Transparent Colored" shader doesn't work so.. I went the UIPanel Texture Mask route but results are weird.

Any suggestions?



EDIT: I remade the shader: http://hastebin.com/vaniqovoce.cg Still not the effect wanted.

5
TNet 3 Support / Re: [SOLVED] TNManager.JoinChannel, 2nd overload
« on: December 14, 2013, 08:20:18 AM »
Ok, thanks Aren. Modified title accordingly.

6
NGUI 3 Support / Re: Label + Dynamic Font Issue
« on: December 13, 2013, 03:50:42 PM »
+1 same thing here.

7
TNet 3 Support / [SOLVED] TNManager.JoinChannel, 2nd overload
« on: December 13, 2013, 03:03:19 PM »
When using the second overload of TNManager.JoinChannel:
  1. TNManager.JoinChannel (int channelID, string levelName, bool persistent, int playerLimit, string password)

How are we supposed to know the player limit of an already created channel without connecting to it? Should we just pass some random value into it?

8
TNet 3 Support / Re: Serializable support
« on: December 10, 2013, 11:05:14 AM »
Yup you can add it to the list of supported data types. Look inside TNUnityTools.cs:

CanBeSerialized, WriteObject, ReadObject
Mmm.. Not what I was expecting but it works. Thanks Aren.

Any chances of getting support for something like Unity's builtin OnSerializeNetworkView in the future?

EDIT: CanBeSerialized and WriteObject already do check typeof whatever is passed in, something like this interface should be easy to adapt.

Wherever you like, inside TNet namespace:
  1. public interface TNSerializable
  2. {
  3.     object OnNetworkReadObject(BinaryReader br);
  4.     void OnNetworkWriteObject(BinaryWriter bw);
  5. }

CanBeSerialized:
  1. if (type == typeof(TNSerializable)) return true;
  2. if (type == typeof(TNSerializable[])) return true;

WriteObject:
  1. else if (type == typeof(TNSerializable))
  2. {
  3.     bw.Write('z');
  4.     tns.OnNetworkWriteObject(bw);
  5. }
  6. else if (type == typeof(TNSerializable[]))
  7. {
  8.     TNSerializable[] arr = (TNSerializable[])obj;
  9.     bw.Write('Z');
  10.     bw.Write(arr.Length);
  11.     for (int i = 0, imax = arr.Length; i < imax; ++i) arr[i].OnNetworkWriteObject(bw);
  12. }

I'm stuck on the reading part.

ReadObject:
  1. case 'z':
  2. {
  3.     // If only we could just call whatever.OnNetworkReadObject(br).
  4.     // We don't know what to read from here:
  5.     ??? bytes = reader.Read???();
  6.     TNSerializable tns = (TNSerializable)bytes; // Will this work? Probably not.
  7.     obj = tns;
  8.     break;
  9. }
  10. case 'Z':
  11. {
  12.     int elements = reader.ReadInt32();
  13.     TNSerializable[] arr = new TNSerializable[elements];
  14.     for (int b = 0; b < elements; ++b) arr[b] = ???
  15.     obj = arr;
  16.     break;
  17. }


9
TNet 3 Support / OnNetworkRead/WriteObject? Serializable support
« on: December 09, 2013, 12:47:32 PM »
Is there any way to define/implement an interface on a class/enum/struct so it can be sent through TNet?

I've searched on the forums but found just two posts, one reveals nothing, the other says enums must be sent as string/int and ensure they are properly casted back and forth.

10
NGUI 3 Support / Re: UIToggleObjects (not a bug) misuse
« on: November 26, 2013, 01:22:04 PM »
I would use the same input field for both. Just have a drop-down in front of it that selects whether the chat will go to everyone, or only to the player's team.
Nice! I just saw the new NGUI 3.0.6 video you made yesterday and it did help me with some things, plus this answer. So simple yet I was doing it so wrongly...

Thanks Aren!

11
NGUI 3 Support / Re: UIToggleObjects bug
« on: November 26, 2013, 08:57:38 AM »
UIToggleObjects doesn't require a UIToggle to be present. You can have it be present anywhere -- such as a manager object, and have your toggle trigger a remote function in its onChange,
That explains why my tabbed chat isn't working... I'm sorry, my bad.
Can I ask a related doubt with it here?

Explicative drawing:

12
NGUI 3 Support / UIToggleObjects (not a bug) misuse
« on: November 26, 2013, 08:32:37 AM »
It lacks a
  1. [RequireComponent(typeof(UIToggle))]
line, manually adding UIToggle works, of course, but this is clearly a requirement for UIToggleObjects to work.

EDIT: Changed title.

13
Hi there fellow TNet users!

I've made this script to auto disable components on all other players (tno.isMine == false) whenever they are created using TNManager.Create.
It's TNAutoCreate's best friend, it has almost the same interface as TNAutoSync, just add components (from the object you attached the script or any of its children) and they'll get disabled on other clients.

Use case: each client will get their hierarchy populated with other players avatar's, this will have scripts and components you don't want to apply on every client (Camera, movement scripts and such)

Here's the code:
https://gist.github.com/toqueteos/3770f2cea1ad48e6fd02
IMPORTANT The TNAutoDisableOthersInspector.cs script needs to be inside an Editor folder otherwise it won't work. Using the .unitypackage file is easier.

Here's a .unitypackage file:
https://www.dropbox.com/s/vp8i59vjl0aitoc/TNET_AutoDisableOthers.unitypackage


Hope you like it!

Any suggestions, bugs or enhancement proposals are welcome.

Pages: [1]