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

Pages: [1] 2 3 ... 6
1
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: February 19, 2017, 07:07:39 AM »
Not sure what "UnityEvent to store a EventDelegate" means. :P

UnityEvent supports static values, but only if the function has a single parameter. Even if I was to consider switching to it, I can't do it as it will completely break all backwards compatibility, in addition to forcing everyone to set up multiple function calls instead of a single function with multiple parameters.

that's true,
i think the only way now is list all the variable of types OTZ

2
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: February 17, 2017, 04:47:07 AM »
You can simply name your buttons 1, 2, 3 and 4 -- then do
  1. void SetPlayers ()
  2. {
  3.     int.TryParse(UIButton.current.name, out players);
  4. }

hi ArenMook,
sorry to push this up again,

the Unity 5 ( not sure since which version ) supports UnityEvent to store a EventDelegate,
I think it's a solution to support this issue :)

3
Yes, that's what i meant.
Just FYI.

Are you talking about the UICamera.currentScheme's getter when it falls through to the end? You can do this:
  1.                 get
  2.                 {
  3.                         if (mCurrentKey == KeyCode.None) return ControlScheme.Touch;
  4.                         if (mCurrentKey >= KeyCode.JoystickButton0) return ControlScheme.Controller;
  5.                         if (current != null && mLastScheme == ControlScheme.Controller &&
  6.                                 (mCurrentKey == current.submitKey0 || mCurrentKey == current.submitKey1))
  7.                                 return ControlScheme.Controller;
  8.  
  9.                         if (current != null)
  10.                         {
  11.                                 if (current.useMouse) return ControlScheme.Mouse;
  12.                                 if (current.useTouch) return ControlScheme.Touch;
  13.                                 return ControlScheme.Controller;
  14.                         }
  15.                         return ControlScheme.Mouse;
  16.                 }

4
when UICamera.useMouse is false, UICamere.currentScheme will still become ControlScheme.Mouse.

That would make a menu controlled by UIKeyNavigation ( there might be others ) become control-less,
until users press up/down/right/left to let UICamere.currentScheme = ControlScheme.Controller.

5
NGUI 3 Support / Re: [UILabel] multi font in one label
« on: September 26, 2016, 04:43:59 PM »
okay, thanks anyway :)

6
NGUI 3 Support / Re: [UILabel] multi font in one label
« on: September 24, 2016, 04:14:07 PM »
yes, i know it's not for now, what i asked is...will it possible in the future updates  :D?

7
NGUI 3 Support / [UILabel] multi font in one label
« on: September 22, 2016, 02:44:44 AM »
is it possible to add a tag to switch font in a label like:

He is a Super Star, I love him.

or even a tag to change the font size :
He is a [size=36]Super Star[/size], I love him.

thanks

8
NGUI 3 Support / Re: [UICamera] is this a bug? (ProcessOthers)
« on: September 13, 2016, 01:58:58 PM »
i think it's 3.9.9
and i checked the changelog of 3.10/3.10.1, i didnt see the log, maybe it's missed?

9
NGUI 3 Support / [UICamera] is this a bug? (ProcessOthers)
« on: September 13, 2016, 10:07:58 AM »
UICamera.cs
line 2225
  1. if (!useMouse && (key >= KeyCode.Mouse0 || key <= KeyCode.Mouse6)) continue;
  2.  

KeyCode.Mouse0 = 323
KeyCode.Mouse6 = 329

 (key >= KeyCode.Mouse0 || key <= KeyCode.Mouse6) will always be true
 (!useMouse && (key >= KeyCode.Mouse0 || key <= KeyCode.Mouse6)) will always be true when useMouse is false

i think it should be this one
  1. if (!useMouse && (key >= KeyCode.Mouse0 && key <= KeyCode.Mouse6)) continue;
  2.  

10
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: August 09, 2016, 11:44:34 PM »
yes but the way limited the naming rule..

consider with this case:
we have to drag an object to assign duration field of a tween, or limit the name of tween's game object.

i feel the same thing when i use the the event delegate with parameters, that's why i suggest the modification since march 2015.

11
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: August 09, 2016, 01:36:20 AM »
a simple example is like:

a player selection menu with 4 players button, and when a button is pressed, call a method to set the players in the game.

current :
  1. // we need to add new apis for new settings, like Set5Player
  2. public void Set1Player(){ players = 1; }
  3. public void Set2Player(){ players = 2; }
  4. public void Set3Player(){ players = 3; }
  5. public void Set4Player(){ players = 4; }
  6.  
  7. // or
  8. // add to a script
  9. public int intValue = 0;
  10.  
  11. // and add this to a manager / singleton, then drag and assign the intValue to the control eventDelegate
  12. public void SetPlayers( int i ){ players = i; }
  13.  

after :
  1. // and add this to a manager / singleton, then just set the value is needed directly in inspector
  2. public void SetPlayers( int i ){ players = i; }
  3.  

12
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: August 07, 2016, 04:55:37 AM »
edit:
yes you are right, if we want to store params by constant value, we need to list all of the values.

but i tested it, each variable needs 38 bytes to store when meta is in text mode, and 360 bytes in binary mode.
maybe it dont bloat so dramatically, could you consider it? that would make the workflow much simpler.

13
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: August 06, 2016, 07:14:21 AM »
thanks!! it is surely a good news!

14
NGUI 3 Support / Re: about EventDalegate drawer/editor
« on: August 04, 2016, 06:46:46 AM »
sorry to pop this thread up, in the 3.10, the constant support is still not added.

i've posted an example here : http://www.tasharen.com/forum/index.php?topic=12781.msg57959#msg57959 ( but i dont think my code is good to use directly ).
is there a plan to add the constant support of EventDelegate?

15
NGUI 3 Support / Re: About RealTime
« on: June 18, 2016, 05:16:15 AM »
this is part of the original Realtime.cs

  1. #if UNITY_4_3
  2.         static RealTime mInst;
  3.  
  4.         float mRealTime = 0f;
  5.         float mRealDelta = 0f;
  6.  
  7.         /// <summary>
  8.         /// Real time since startup.
  9.         /// </summary>
  10.  
  11.         static public float time
  12.         {
  13.                 get
  14.                 {
  15.  #if UNITY_EDITOR
  16.                         if (!Application.isPlaying) return Time.realtimeSinceStartup;
  17.  #endif
  18.                         if (mInst == null) Spawn();
  19.                         return mInst.mRealTime;
  20.                 }
  21.         }
  22.  
  23.         /// <summary>
  24.         /// Real delta time.
  25.         /// </summary>
  26.  
  27.         static public float deltaTime
  28.         {
  29.                 get
  30.                 {
  31.  #if UNITY_EDITOR
  32.                         if (!Application.isPlaying) return 0f;
  33.  #endif
  34.                         if (mInst == null) Spawn();
  35.                         return mInst.mRealDelta;
  36.                 }
  37.         }
  38.  

if not, i dont understand why deal with !Application.isPlaying
what's why i used it for some editor tools, part of them use UITweener, although i know how to fix the issue, but i don't want to modify a script of a plugin ( that case some issue when upgrade )

if it's not design for editor mode using, could ArenMook please add support of editor mode using?

Pages: [1] 2 3 ... 6