Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
NGUI 3 Support / Re: Special Characters Break Text Wrapping
« Last post by ArenMook on March 29, 2018, 12:02:08 PM »
You really should be using emoticons instead.
32
NGUI 3 Support / Re: Vector3.one and Vector3(1,1,1)
« Last post by ArenMook on March 29, 2018, 12:00:50 PM »
Zero is an invalid scale. You can't divide by zero, so inverse transform can't be calculated. You're shooting yourself in the foot whenever you use a zero scale. Consider changing it to 0.001 instead.

Your question is also not an NGUI question, and not even a Unity question, but a basic C# question. In C# you need to prefix new object declarations with a "new".
33
NGUI 3 Support / Re: iPhone X display NGUI support
« Last post by ArenMook on March 29, 2018, 11:57:34 AM »
He asked in Discord. Just join Tasharen's discord (https://discord.gg/trruSNc) and scroll up in the #ngui-support channel to February 19th and you will see the conversation.

Quote
Kafar - 02/19/2018
I read NGUI support is moved here, so I put here my post:   Hello,

I read the only one post who talk about this topic (http://www.tasharen.com/forum/index.php?topic=15480.0) but it not is for me.
I have a UI Root and inside it many other UIpanels, UIButtons, etc, all anchored but on iPhone X the result is that the gui go partially off to the edge of the screen.

I tried also with this sample project https://bitbucket.org/p12tic/iossafeareasplugin mentioned in the other post but that sample not is for NGUI. My problem is my app run on all Apple and Android devices, then I can't adjust the widget's offsets for iPhone X only because this will impact on all other devices.

So, definitively, there are solutions (in this case) with NGUI?
Many thanks.
p12tic / iOSSafeAreasPlugin
A Unity project containing a native plugin wrapping iOS safe areas APIs
I forgot..... googling I can't found nothing about this
@Aren
Aren - 02/19/2018
https://answers.unity.com/questions/1432365/how-to-detect-iphone-x-or-ipad-using-iosdevicegene.html

@Kafar
if the device is not iphone x, disable that adjustment script of yours
Kafar - 02/19/2018
Thank @Aren but after I checked the device is a iPhone X I can  adjust UIpanels, UIWidgets, NGUI etc via code?
Aren - 02/19/2018
you should adjust the UICamera's camera's viewport
if you adjust that, you don't need to do anything
basically offset the viewport on the top by X pixels, where X is what's needed
Kafar - 02/19/2018
CORRECT!!!! MANY THANKS!
but.... viewport or Field of View?
I tried to offset the viewport but nothing change, with Field of View yes
Aren - 02/19/2018
Viewport Rect
Kafar - 02/19/2018
yes, Viewport Rect, I changed but nothing change
Viewport Rect accept negative values also?
Aren - 02/19/2018
yeah
if you have a sprite anchored across the entire screen, you will see it move when you adjust the viewport rect
simplest script for you is -- have the viewport rect be adjusted to what you need it to be for iphone x, then have your script simply set the rect to 0 and 1's if it's not iphone x
Kafar - 02/19/2018
ok, thanks!
Kafar - 02/19/2018
@Aren I'm sorry but I don't understand.... if I edit values for Viewport Rect X the GUI move to right or left but it not fit. Same thing if I edit Y or W or H. What is wrong?
Aren - 02/19/2018
try setting height to 0.97
there will be empty space on top equal to 0.03 * screen height pixels
Kafar - 02/19/2018
from code is Camera.ViewportToScreenPoint(Vector3)? If yes, the X, Y, W, H and specifically the H where I set it?
Aren - 02/19/2018
?
select the game object in inspector
set its camera script viewport rect
Kafar - 02/19/2018
no, I need to do in the script, in the case the app don't run on the iphonex
Aren - 02/19/2018
consult unity's documentation for how to set viewport rect via code, or look at the UIViewport script
Camera.rect
34
TNet 3 Support / Re: TNServer runs much slower with multiple cores on linux
« Last post by ArenMook on March 29, 2018, 11:52:17 AM »
I expect Windows to work faster, since it uses IO Completion ports, which is a Windows feature. Plus, on Windows it runs using .NET, while on Linux it runs through Mono.

Windows will win.
35
NGUI 3 Support / Special Characters Break Text Wrapping [Solved]
« Last post by stc105 on March 28, 2018, 11:11:48 PM »
Using special characters from a font like FontAwesome (see https://fontawesome.com/v4.7.0/) will cause the text wrapping to break on UILabel.

I'll look into why later - if ArenMook doesn't look into it.
36
NGUI 3 Support / Vector3.one and Vector3(1,1,1)
« Last post by Elapse on March 28, 2018, 08:28:42 AM »
Hi there,

I want to change the Buttons scale in two ways in different situations. For one way it works fine:

//when I start the menu
//position changes aswell

TweenScale tweenS = prefab.GetComponent<TweenScale>();
      tweenS.from = Vector3.zero;
      tweenS.to = Vector3.one;   <-----why Vector3(1,1,1) instead leads to an error? how to fix it?
      tweenS.PlayForward();

The Problem is, that I need to change the values to Vector3(1.5, 1.5, 1.5) for the next way. The Unity API says that Vector3.one is just a short version of Vector3(1,1,1). I'm confused.

Thanks for help and have a good day. Marten
37
NGUI 3 Support / ButtonColor with KeyBinding
« Last post by Elapse on March 26, 2018, 01:54:07 PM »
Hi there,

I've went through the Video tutorials and want to create an Action Button. I've created a Button and added the KeyBinding script. In Playmode the Button Color changes like it should when I click it with the mouse but when I use the Key it doesn't change like it does in the video. It triggers the script I attached to it however. Whats the problem?

Thanks, Marten
38
TNet 3 Support / Re: TNServer runs much slower with multiple cores on linux
« Last post by lance on March 26, 2018, 06:35:33 AM »
Have you done performance test on Linux server? How do performance on linux server compare to windows server? thanks!

I'm not aware of anything related to this, so can't say. I don't do anything special.
39
TNet 3 Support / Re: TNServer runs much slower with multiple cores on linux
« Last post by ArenMook on March 26, 2018, 05:49:44 AM »
I'm not aware of anything related to this, so can't say. I don't do anything special.
40
TNet 3 Support / Re: Latest Version: 3.1.0 (September 22, 2017)
« Last post by ArenMook on March 26, 2018, 05:42:58 AM »
3.2.0
- NEW: DataNode can now export entire bundles (think AssetBundle, but with DataNode). Just select a folder (or multiple files) and use the Assets->DataNode->Export feature. It's up to you to determine what to do about importing the bundles (I use a custom Prefab Manager in Sightseer for example), but an example import functionality and function is included (Assets->DataNode->Import supports them).
- NEW: DataNode can now export audio clips.
- NEW: DataNode now exports textures in their native compressed state, rather than forcing RGBA.
- NEW: It's now possible to add custom serialization functions for all data types by using extensions, without the need for an interface. Read comments above #define SERIALIZATION_WITHOUT_INTERFACE for more info. This makes it possible to add custom serialization for all Unity and 3rd party data types as well.
- NEW: Made it possible to specify custom protocol handling which would bypass sockets. Immediate use: Steam's networking API.
- NEW: Added a low memory footprint mode to the game server. Use the 'lm' keyword to enable it once the server is running. LM mode means once the last player leaves, channel data will be unloaded. Can save memory at the expense of extra time spent loading channel data when players rejoin.
- NEW: Made it possible to assign a custom connection to both the TNManager, and individual connections of the Game Server. I used it in Sightseer to add support for Steam networking: basically instead of using sockets, TNet can now also use Steam's Networking API.
- NEW: It's now possible to specify the root directory on the file server (game server's parent class) to use for all file-based operations.
- NEW: Numerous DataNode serialization fixes and improvements to make it possible for it to serialize prefabs properly, including iffy types like ParticleSystems.
- NEW: Added a Max Packet Time to the game client that TNet will spend processing packets each Update. Can be used to automatically split up packet processing across multiple frames.
- NEW: Added #define options to the game client to provide packet profiling. If enabled, all incoming packets will show up in the Unity's Profiler.
- NEW: WorkerThread now supports coroutines for the main thread's callback.
- NEW: Replaced TNObject/TNBehaviour's Start functions with a custom setup to avoid a bug in Unity that causes disabling components with a Start() function to take 100+ times longer than normal.
- NEW: Added TNManager.Disconnect(delay). Can be useful if there are still packets that need to be sent out before disconnecting. Will prevent all further packets from being sent out or being received.
- NEW: Added a built-in server side check that prevents multiple players from requesting the same player save file.
- NEW: TNet now keeps a list of sent RFC names with their count while in the editor so that you can track which RFCs happen to be called too frequently.
- NEW: Added Vector2D and Vector3D -- double precision version of Unity's vectors.
- NEW: Added TNManager.Export and Import -- the ability to export and import objects from the server. This effectively sends all the RCC and RFCs from the server to the client that are necessary to import a group of objects in the future. In Sightseer I use it to save entire groups of pre-configured assets (such as a fully equipped player vehicle complete with inventory contents) then instantiate them easily after moving them somewhere.
- NEW: TNet's function calls will now automatically try to convert parameters if they don't quite match. For example changing an RFC to pass a Vector3D instead of a Vector3 will no longer break serialization.
- NEW: Added TNObject.Find(fullID) and TNObject.fullID. It's a combination of channel+object ID in one.
- NEW: Added a new "MODDING" #define. If enabled, TNet will be compiled in a stripped-down mode with serialization intact, but connectivity inoperable. This is meant for making exporter mod DLLs.
- NEW: Object and component references are now serialized using IDs instead of strings for less space and faster lookup.
- FIX: Updating a saved RFC on the server will now move it to the end of the saved RFC list, ensuring that it's called in the correct order on load.
- FIX: Fixed the Tcp Lobby link sending server updates every 5 seconds even if nothing changed. It now sends Ping packets instead.
- FIX: Changed ban and admin lists to be hashsets instead for faster lookups.
- FIX: Fixed DataNode's GetHierarchy causing GC allocations.
- FIX: Calling SetChannelData should now persist, even if nothing was actually instantiated in that channel.
- FIX: DataNode can now contain other DataNode values in its nodes' value field without breaking serialization.
- FIX: HTTP responses now use UTF-8.
Pages: 1 2 3 [4] 5 6 ... 10