Skip to content

Commit ca70b2d

Browse files
authored
Merge pull request #17 from coryleach/dev
Punch tween fix
2 parents 625e3c1 + 78642a9 commit ca70b2d

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Includes a SRP shader for blurring the background of UI panels.
2323
#### Using UnityPackageManager (for Unity 2019.3 or later)
2424
Open the package manager window (menu: Window > Package Manager)<br/>
2525
Select "Add package from git URL...", fill in the pop-up with the following link:<br/>
26-
https://github.com/coryleach/UnityGUI.git#3.0.2<br/>
26+
https://github.com/coryleach/UnityGUI.git#3.0.3<br/>
2727

2828
#### Using UnityPackageManager (for Unity 2019.1 or later)
2929

3030
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
3131
```js
3232
{
3333
"dependencies": {
34-
"com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.2",
34+
"com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.3",
3535
...
3636
},
3737
}

Runtime/Tween/TransformTweenExtensions.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,20 @@ public static async void DoLocalMove(this Transform transform, Vector3 position,
8383
await transform.DoLocalMoveAsync(position, duration, easing).ConfigureAwait(false);
8484
}
8585

86-
public static async Task DoPunchPosition(this Transform transform, Vector3 position, float duration, Easing easing = Easing.Linear)
86+
public static async Task DoPunchPositionAsync(this Transform transform, Vector3 position, float duration, Easing easing = Easing.Linear)
8787
{
8888
var startPos = transform.position;
89-
await TweenExtensions.DoTweenAsync(transform.gameObject.GetInstanceID(), duration, (t) =>
89+
await TweenExtensions.DoPunchTweenAsync(transform.gameObject.GetInstanceID(), duration, (t) =>
9090
{
91-
t *= 2;
92-
if (t > 1)
93-
{
94-
t = 2 - t;
95-
}
96-
9791
var pt = Vector3.Lerp(startPos, position, t);
9892
transform.localPosition = pt;
9993
}, easing);
10094
}
10195

102-
96+
public static async void DoPunchPosition(this Transform transform, Vector3 position, float duration, Easing easing = Easing.Linear)
97+
{
98+
await transform.DoPunchPositionAsync(position, duration, easing);
99+
}
100+
103101
}
104102
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.gameframe.gui",
33
"displayName": "Gameframe.GUI",
4-
"version": "3.0.2",
4+
"version": "3.0.3",
55
"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.",
66
"keywords": [],
77
"author": {

0 commit comments

Comments
 (0)