|
@@ -6,6 +6,10 @@ public class Trans_Float : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
public PlayerController controller;
|
|
public PlayerController controller;
|
|
|
|
|
|
|
|
|
|
+ private bool isFirst; //第一次攻击
|
|
|
|
|
+ private int times; //攻击次数
|
|
|
|
|
+ public int minTime, maxTime; //保底范围
|
|
|
|
|
+
|
|
|
private void Start()
|
|
private void Start()
|
|
|
{
|
|
{
|
|
|
controller = GetComponentInParent<PlayerController>();
|
|
controller = GetComponentInParent<PlayerController>();
|
|
@@ -16,6 +20,20 @@ public class Trans_Float : MonoBehaviour
|
|
|
if (controller.isinputJ)
|
|
if (controller.isinputJ)
|
|
|
{
|
|
{
|
|
|
controller.isinputJ = false;
|
|
controller.isinputJ = false;
|
|
|
|
|
+ if (isFirst)
|
|
|
|
|
+ {
|
|
|
|
|
+ isFirst = false;
|
|
|
|
|
+ //触发
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ times += 1;
|
|
|
|
|
+ if (times >= minTime || times == maxTime)
|
|
|
|
|
+ {
|
|
|
|
|
+ times = 0;
|
|
|
|
|
+ //触发
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
GetComponent<Demonic>().Attack2();
|
|
GetComponent<Demonic>().Attack2();
|
|
|
}
|
|
}
|
|
|
if (controller.isinputK)
|
|
if (controller.isinputK)
|