diff --git a/README.md b/README.md
index f2ed31c..a62cb2b 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Includes a SRP shader for blurring the background of UI panels.
#### Using UnityPackageManager (for Unity 2019.3 or later)
Open the package manager window (menu: Window > Package Manager)
Select "Add package from git URL...", fill in the pop-up with the following link:
-https://github.com/coryleach/UnityGUI.git#3.0.8
+https://github.com/coryleach/UnityGUI.git#3.0.9
#### Using UnityPackageManager (for Unity 2019.1 or later)
@@ -30,7 +30,7 @@ Find the manifest.json file in the Packages folder of your project and edit it t
```js
{
"dependencies": {
- "com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.8",
+ "com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.9",
...
},
}
diff --git a/Runtime/Tween/MaterialTweenExtensions.cs b/Runtime/Tween/MaterialTweenExtensions.cs
new file mode 100644
index 0000000..01604f1
--- /dev/null
+++ b/Runtime/Tween/MaterialTweenExtensions.cs
@@ -0,0 +1,25 @@
+using System.Threading.Tasks;
+using UnityEngine;
+
+namespace Gameframe.GUI.Tween
+{
+ public static class MaterialTweenExtensions
+ {
+ public static async Task DoFloatAsync(this Material material, int propertyId, float startValue, float endValue, float duration, Easing easing = Easing.Linear, AnimationCurve customCurve = null)
+ {
+ await TweenExtensions.DoTweenAsync(material.GetInstanceID(), duration, (t) =>
+ {
+ material.SetFloat(propertyId, Mathf.Lerp(startValue, endValue, t));
+ }, easing, customCurve);
+ }
+
+ public static async Task DoFloatAsync(this Material material, string propertyName, float startValue, float endValue, float duration, Easing easing = Easing.Linear, AnimationCurve customCurve = null)
+ {
+ var propertyId = Shader.PropertyToID(propertyName);
+ await TweenExtensions.DoTweenAsync(material.GetInstanceID(), duration, (t) =>
+ {
+ material.SetFloat(propertyId, Mathf.Lerp(startValue, endValue, t));
+ }, easing, customCurve);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Runtime/Tween/MaterialTweenExtensions.cs.meta b/Runtime/Tween/MaterialTweenExtensions.cs.meta
new file mode 100644
index 0000000..ad17c95
--- /dev/null
+++ b/Runtime/Tween/MaterialTweenExtensions.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ef48324267f24a82b86aeb8d601d0284
+timeCreated: 1694451375
\ No newline at end of file
diff --git a/Runtime/Tween/TweenExtensions.cs b/Runtime/Tween/TweenExtensions.cs
index 76b728f..28b1a70 100644
--- a/Runtime/Tween/TweenExtensions.cs
+++ b/Runtime/Tween/TweenExtensions.cs
@@ -46,6 +46,11 @@ public static void DoKillTweens(this GameObject obj)
}
public static void DoKillTweens(this Component obj)
+ {
+ CancelTweensForId(obj.gameObject.GetInstanceID());
+ }
+
+ public static void DoKillTweens(this UnityEngine.Object obj)
{
CancelTweensForId(obj.GetInstanceID());
}
@@ -144,7 +149,7 @@ private static void CompleteTween(int id)
_tweenDict.Remove(id);
}
- private static void CancelTweensForId(int id)
+ public static void CancelTweensForId(int id)
{
if (!_tweenDict.TryGetValue(id, out var tweenData))
{
diff --git a/package.json b/package.json
index 48471f3..27a0a1a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "com.gameframe.gui",
"displayName": "Gameframe.GUI",
- "version": "3.0.8",
+ "version": "3.0.9",
"description": "This is a library of GUI helpers for UGUI \r\nIncludes a panel system that implements a navigation stack. \r\nIncludes a scene transition system. \r\nIncludes a SRP shader for blurring the background of UI panels.",
"keywords": [],
"author": {