Author Topic: UITweenerEditor Method  (Read 5946 times)

zeiphon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
UITweenerEditor Method
« on: January 25, 2014, 08:19:27 PM »
Just wondering why in UITweenerEditor.cs ~line 31, this is commented out?
  1. //UITweener.Method method = (UITweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.method);
I actually came to this file to write exactly that, so wondering if there is any reason this might want to be avoided.
Is 'method' obsolete?

Also, may I suggest adding something akin to the following:
  1. UITweener.Method method = (UITweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.method);
  2.  
  3. bool sc = tw.steeperCurves;
  4. if (method == UITweener.Method.EaseIn || method == UITweener.Method.EaseInOut || method == UITweener.Method.EaseOut)
  5.     sc = EditorGUILayout.Toggle("Steeper Curves", tw.steeperCurves);
Though that If statement admittedly isn't the best way to go about it.

Edit: Just saw this: http://www.tasharen.com/forum/index.php?topic=7799.0
I'm thinking either that's quite a coincidence, or this sort of question gets asked a lot.
« Last Edit: January 25, 2014, 08:24:49 PM by zeiphon »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITweenerEditor Method
« Reply #1 on: January 26, 2014, 09:09:39 PM »
Because it's legacy functionality. You should be using the curve on the tweens. Using that field you can create all kinds of interpolation methods, not just linear, ease and bounce.

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: UITweenerEditor Method
« Reply #2 on: January 27, 2014, 09:04:30 AM »
sounds like it would be useful to add bounce in/bounce out to the list of NGUI presets

zeiphon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UITweenerEditor Method
« Reply #3 on: January 30, 2014, 04:58:36 PM »
Because it's legacy functionality. You should be using the curve on the tweens. Using that field you can create all kinds of interpolation methods, not just linear, ease and bounce.

Ah so it's deprecated. Would you mind marking it as such?
To be honest, it's still actually quite useful for adding another layer of smoothing on top of the animation curve.
I don't know about everyone else, but I find animation curves tricky to get right due to their relatively low fidelity and the inability to specify numeric values in the editor.

Thanks!

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: UITweenerEditor Method
« Reply #4 on: January 31, 2014, 07:19:23 AM »
since bounce is a mathematical function, it doesn't make sense to try and create it by hand it's too fiddly and the end results is unlikely to look good, I've left mine using the deprecated functions

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: UITweenerEditor Method
« Reply #5 on: January 31, 2014, 07:45:25 AM »
ok just doing a little digging and realised the animations curves aren't a feature of NGUI, (which is kinda a relief because I'm always asking myself "how da mook" does this guy keep adding all these features? - there isn't the hours in the day)

the curve presets live in the following directory (windows):    ...\AppData\Roaming\Unity\Editor-4.x\Preferences\Presets in a file called "default.curves", which makes me think it'd be very easy to find a bunch of presets already setup something like this...
http://stackoverflow.com/questions/5161465/how-to-create-custom-easing-function-with-core-animation

but I couldn't find anything, possibly could use itweens to generate some curves