@@ -1160,6 +1160,25 @@ public static SlimTransform scaleZ(Transform transform, float to, float duration
11601160 /// <param name="transform">The transform to scale.</param>
11611161 /// <param name="to">Target scale value.</param>
11621162 /// <param name="duration">Duration to reach the target.</param>
1163+ /// <param name="pivot">Target pivot.</param>
1164+ /// <exception cref="STweenException"></exception>
1165+ public static STFloat scaleAround ( Transform transform , Vector3 pivot , Vector3 to , float duration )
1166+ {
1167+ if ( transform is null )
1168+ {
1169+ throw new STweenException ( "Transform can't be null." ) ;
1170+ }
1171+
1172+ var instance = STPool . GetInstance < STFloat > ( transform . gameObject . GetInstanceID ( ) ) ;
1173+ Vector3 from = transform . localScale ;
1174+
1175+ instance . SetBase ( 0 , 1 , duration , x=> { lerpScaleAround ( transform , pivot , Vector3 . LerpUnclamped ( from , to , x ) ) ; } ) ;
1176+ return instance ;
1177+ }
1178+ ///<summary>Scales a transform.</summary>
1179+ /// <param name="transform">The transform to scale.</param>
1180+ /// <param name="to">Target scale value.</param>
1181+ /// <param name="duration">Duration to reach the target.</param>
11631182 /// <exception cref="STweenException"></exception>
11641183 public static SlimTransform scale ( Transform transform , Vector3 to , float duration )
11651184 {
@@ -1947,7 +1966,20 @@ private static IEnumerable<TweenClass> GetActiveTweens(TweenClass t)
19471966 }
19481967 ///<summary>Checks if an instance is tweening.</summary>
19491968 public static bool IsTweening ( TweenClass vtween ) { return vtween . IsTweening ; }
1969+ /// <summary>Check pause state of a tween instance.</summary>
1970+ /// <param name="vtween">Tween instance.</param>
19501971 public static bool IsPaused ( TweenClass vtween ) { return vtween . IsPaused ; }
1972+ /// <summary>Tries to find active tween.</summary>
1973+ /// <param name="gameObject">GameObject.</param>
1974+ /// <param name="stween">Tween instance.</param>
1975+ public static bool TryFindTween ( GameObject gameObject , out TweenClass stween )
1976+ {
1977+ var t = TweenExtension . GetTween ( gameObject . GetInstanceID ( ) , out var obj ) ;
1978+ stween = obj ;
1979+ return t ;
1980+ }
1981+ /// <summary>Check pause state of a tween instance.</summary>
1982+ /// <param name="id">Tween id.</param>
19511983 public static bool IsPaused ( int id )
19521984 {
19531985 return TweenExtension . GetTween ( id , out var tw ) && tw . IsPaused ;
@@ -1957,7 +1989,7 @@ public static bool IsTweening(int customId)
19571989 {
19581990 return TweenExtension . GetTween ( customId , out var tw ) && tw . IsTweening ;
19591991 }
1960- ///<summary>Reinitialize the max tweens.</summary>
1992+ ///<summary>(EXPERIMENTAL!) Reinitialize the max tweens pool .</summary>
19611993 public static void Init ( int newSize ) { TweenManager . InitSize ( newSize ) ; }
19621994 #endregion
19631995 }
0 commit comments