-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAutoClickerTool.cs
78 lines (71 loc) · 2.2 KB
/
AutoClickerTool.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// This code is part of the Fungus library (https://github.com/snozbot/fungus)
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
{
public enum threeFramu2
{
Enable,
Disable
}
/// <summary>
/// Tween sequence
/// </summary>
[CommandInfo("Scripting",
"Clicker tool",
"This is a dev-tool. Disable this on build")]
[AddComponentMenu("")]
[ExecuteInEditMode]
public class AutoClickerTool : Command
{
[SerializeField] public threeFramu2 splashSelect;
public static bool isrunning = false;
protected float delay = 0.2f;
//public DialogInput dialogInput;
protected List<Command> commandList = new List<Command>();
private int comIn = 0;
public IEnumerator Clicker()
{
isrunning = true;
WaitForSeconds waiting = new WaitForSeconds(delay);
while(isrunning)
{
comIn++;
if(isrunning == true)
{
if (ParentBlock != null)
{
ParentBlock.JumpToCommandIndex = comIn++;
yield return waiting;
}
}
else
{
yield break;
}
}
}
public override void OnEnter()
{
Canvas.ForceUpdateCanvases();
//SayDialog sayDialog = SayDialog.GetSayDialog();
//dialogInput = sayDialog.GetComponent<DialogInput>();
switch (splashSelect)
{
case (threeFramu2.Disable):
isrunning = false;
break;
case (threeFramu2.Enable):
StartCoroutine(Clicker());
break;
}
Continue();
}
public override void OnCommandAdded(Block parentBlock)
{
splashSelect = threeFramu2.Disable;
}
}
}