Skip to content

Commit b56b5ea

Browse files
committed
ActionKit 修复 Repeat 的 Sequence 没有正确回收的问题(感谢群友 学猫叫的鹦鹉提供问题反馈)
1 parent e2612c0 commit b56b5ea

4 files changed

Lines changed: 40 additions & 5 deletions

File tree

QFramework.Toolkits.unitypackage

446 Bytes
Binary file not shown.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Id": "",
3-
"Version": "v1.0.40",
3+
"Version": "v1.0.41",
44
"Type": 0,
55
"AccessRight": 0,
66
"DownloadUrl": "",
@@ -11,10 +11,10 @@
1111
],
1212
"DocUrl": "https://liangxiegame.com",
1313
"Readme": {
14-
"version": "v1.0.40",
15-
"content": "UIKit:重复 LoadPanel 代码删除(感谢高跟鞋、NormalKatt 提供反馈)",
14+
"version": "v1.0.41",
15+
"content": "ActionKit 修复 Repeat 的 Sequence 没有正确回收的问题",
1616
"author": "liangxie",
17-
"date": "2023 年 032117:43",
17+
"date": "2023 年 042015:11",
1818
"PackageId": ""
1919
}
2020
}

QFramework.Unity2018+/Assets/QFramework/Toolkits/_CoreKit/ActionKit/Example/4.Repeat/RepeatExample.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,40 @@ private void Start()
1818
.Start(this, () =>
1919
{
2020
Debug.Log("Right click finished");
21+
22+
ActionKit.Repeat(5)
23+
.Condition(() => Input.GetMouseButtonDown(1))
24+
.Callback(() => Debug.Log("Mouse right clicked"))
25+
.Start(this, () =>
26+
{
27+
Debug.Log("Right click finished");
28+
29+
ActionKit.Repeat(5)
30+
.Condition(() => Input.GetMouseButtonDown(1))
31+
.Callback(() => Debug.Log("Mouse right clicked"))
32+
.Start(this, () =>
33+
{
34+
Debug.Log("Right click finished");
35+
36+
ActionKit.Repeat(5)
37+
.Condition(() => Input.GetMouseButtonDown(1))
38+
.Callback(() => Debug.Log("Mouse right clicked"))
39+
.Start(this, () =>
40+
{
41+
Debug.Log("Right click finished");
42+
43+
ActionKit.Repeat(5)
44+
.Condition(() => Input.GetMouseButtonDown(1))
45+
.Callback(() => Debug.Log("Mouse right clicked"))
46+
.Start(this, () =>
47+
{
48+
Debug.Log("Right click finished");
49+
50+
51+
});
52+
});
53+
});
54+
});
2155
});
2256
}
2357
}

QFramework.Unity2018+/Assets/QFramework/Toolkits/_CoreKit/ActionKit/Scripts/Internal/Action/Repeat.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface IRepeat : ISequence
1616

1717
public class Repeat : IRepeat
1818
{
19-
private Sequence mSequence = Sequence.Allocate();
19+
private Sequence mSequence = null;
2020

2121
private int mRepeatCount = -1;
2222
private int mCurrentRepeatCount = 0;
@@ -31,6 +31,7 @@ private Repeat()
3131
public static Repeat Allocate(int repeatCount = -1)
3232
{
3333
var repeat = mSimpleObjectPool.Allocate();
34+
repeat.mSequence = Sequence.Allocate();
3435
repeat.Deinited = false;
3536
repeat.Reset();
3637
repeat.mRepeatCount = repeatCount;

0 commit comments

Comments
 (0)