概要
2012/7/9 に「LeanTween」がリリースされました
「LeanTween」は Unity 3.5 の頃から使われ続けている Tween ライブラリです
検証環境
- Unity 2017.1.1f1
- LeanTween 2.45
使用例
LeanTween .value( button.gameObject, button.anchoredPosition, new Vector2( 200,100 ), 1f ) .setOnUpdate( ( Vector2 val ) => button.anchoredPosition = val ) ; LeanTween .value( gameObject, 1, 0.5f, 1 ) .setOnUpdate( ( float volume ) => Debug.Log( "volume:" + volume ) ) ; LeanTween .value( gameObject, gameObject.transform.position, gameObject.transform.position + new Vector3( 0, 1, 0 ), 1 ) .setOnUpdate( ( Vector3 val ) => gameObject.transform.position = val ) ; LeanTween .value( gameObject, Color.red, Color.green, 1 ) .setOnUpdate( ( Color val ) => { var image = button.gameObject.GetComponent<Image>(); image.color = val; } ); LeanTween .move( button, new Vector3( 200, -100, 0 ), 1 ) .setDelay( 1 ) ; LeanTween .rotateAround( button, Vector3.forward, 90, 1 ) .setDelay( 2 ) ; LeanTween .scale( button, button.localScale * 2, 1 ) .setDelay( 3 ) ; LeanTween .rotateAround( button, Vector3.forward, -90, 1 ) .setDelay( 4 ) .setEase( LeanTweenType.easeInOutElastic ) ;