This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tween chain
- Loading branch information
heguanfeng
committed
Aug 7, 2020
1 parent
4a9cd36
commit 66b132d
Showing
10 changed files
with
145 additions
and
7 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Assets/MotionFramework/Scripts/Runtime/Module/Module.Tween/ITweenChain.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//-------------------------------------------------- | ||
// Motion Framework | ||
// Copyright©2020-2020 何冠峰 | ||
// Licensed under the MIT license | ||
//-------------------------------------------------- | ||
|
||
namespace MotionFramework.Tween | ||
{ | ||
public interface ITweenChain | ||
{ | ||
ITweenChain Append(ITweenNode node); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/MotionFramework/Scripts/Runtime/Module/Module.Tween/ITweenChain.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Assets/MotionFramework/Scripts/Runtime/Module/Module.Tween/TweenChain.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
Assets/MotionFramework/Scripts/Runtime/Module/Module.Tween/TweenChain/TweenChainExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
//-------------------------------------------------- | ||
// Motion Framework | ||
// Copyright©2020-2020 何冠峰 | ||
// Licensed under the MIT license | ||
//-------------------------------------------------- | ||
|
||
namespace MotionFramework.Tween | ||
{ | ||
public static partial class TweenChainExtension | ||
{ | ||
/// <summary> | ||
/// 添加节点 | ||
/// </summary> | ||
public static ITweenChain Append(this ITweenChain chain, ITweenNode node) | ||
{ | ||
return chain.Append(node); | ||
} | ||
|
||
/// <summary> | ||
/// 条件等待节点 | ||
/// </summary> | ||
public static ITweenChain Until(this ITweenChain chain, System.Func<bool> condition) | ||
{ | ||
return chain.Append(UntilNode.Allocate(condition)); | ||
} | ||
|
||
/// <summary> | ||
/// 执行节点 | ||
/// </summary> | ||
public static ITweenChain Execute(this ITweenChain chain, System.Action execute) | ||
{ | ||
return chain.Append(ExecuteNode.Allocate(execute)); | ||
} | ||
|
||
|
||
/// <summary> | ||
/// 延迟计时节点 | ||
/// </summary> | ||
public static ITweenChain Delay(this ITweenChain chain, float delay, System.Action triggerCallback = null) | ||
{ | ||
return chain.Append(TimerNode.AllocateDelay(delay, triggerCallback)); | ||
} | ||
|
||
/// <summary> | ||
/// 重复计时节点 | ||
/// 注意:该节点为无限时长 | ||
/// </summary> | ||
public static ITweenChain Repeat(this ITweenChain chain, float delay, float interval, System.Action triggerCallback = null) | ||
{ | ||
return chain.Append(TimerNode.AllocateRepeat(delay, interval, triggerCallback)); | ||
} | ||
|
||
/// <summary> | ||
/// 重复计时节点 | ||
/// </summary> | ||
public static ITweenChain Repeat(this ITweenChain chain, float delay, float interval, float duration, System.Action triggerCallback = null) | ||
{ | ||
return chain.Append(TimerNode.AllocateRepeat(delay, interval, duration, triggerCallback)); | ||
} | ||
|
||
/// <summary> | ||
/// 重复计时节点 | ||
/// </summary> | ||
public static ITweenChain Repeat(this ITweenChain chain, float delay, float interval, long maxTriggerCount, System.Action triggerCallback = null) | ||
{ | ||
return chain.Append(TimerNode.AllocateRepeat(delay, interval, maxTriggerCount, triggerCallback)); | ||
} | ||
|
||
/// <summary> | ||
/// 持续计时节点 | ||
/// </summary> | ||
public static ITweenChain Duration(this ITweenChain chain, float delay, float duration, System.Action triggerCallback = null) | ||
{ | ||
return chain.Append(TimerNode.AllocateDuration(delay, duration, triggerCallback)); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...otionFramework/Scripts/Runtime/Module/Module.Tween/TweenChain/TweenChainExtension.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.