Browse Source

add kill on end

master
jkpete 4 months ago
parent
commit
de6073356c
  1. 2
      Example/Tween/EGTween.tscn
  2. 2
      Example/Tween/Script/TweenTest.cs
  3. 6
      addons/EGFramework/Module/NodeExtension/EGTweenExtension.cs

2
Example/Tween/EGTween.tscn

@ -27,4 +27,4 @@ position = Vector2(146, 80) @@ -27,4 +27,4 @@ position = Vector2(146, 80)
[node name="Polygon2D" type="Polygon2D" parent="."]
position = Vector2(146, 97)
polygon = PackedVector2Array(0, 0, 100, 0, 213.683, 76.1096, 454, 237, 0, 100, 0, 0)
polygon = PackedVector2Array(0, 0, 100, 0, 327, 56, 454, 237, 0, 100, 0, 0)

2
Example/Tween/Script/TweenTest.cs

@ -33,7 +33,7 @@ namespace EGFramework.Examples.TweenAnime{ @@ -33,7 +33,7 @@ namespace EGFramework.Examples.TweenAnime{
// tween3.TweenProperty(Target,"size",new Vector2(40,100),0.5f);
// tween3.TweenProperty(Target,"size",new Vector2(40,40),0.5f);
// tween3.SetLoops();
Target2D.TweenRotationByAngle(360f,1.0f);
Target2D.TweenRotationByAngle(360f,1.0f).KillOnEnd();
}
public void TweenOver(){

6
addons/EGFramework/Module/NodeExtension/EGTweenExtension.cs

@ -4,6 +4,12 @@ using System; @@ -4,6 +4,12 @@ using System;
namespace EGFramework.EGTween{
public static class EGTweenExtension
{
#region Function
public static Tween KillOnEnd(this Tween self){
self.TweenCallback(Callable.From(self.Kill));
return self;
}
#endregion
#region Position
public static Tween TweenPosition(this Control self,Vector2 position,float delay){
Tween tween = self.CreateTween();

Loading…
Cancel
Save