|
@@ -6,10 +6,12 @@ public class Trans_Float : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
public PlayerController controller;
|
|
public PlayerController controller;
|
|
|
|
|
|
|
|
- private bool isFirst; //第一次攻击
|
|
|
|
|
|
|
+ private bool isFirst = true; //第一次攻击
|
|
|
private int times; //攻击次数
|
|
private int times; //攻击次数
|
|
|
public int minTime, maxTime; //保底范围
|
|
public int minTime, maxTime; //保底范围
|
|
|
|
|
|
|
|
|
|
+ public bool toFloat = false; //攻击触发漂浮
|
|
|
|
|
+
|
|
|
private void Start()
|
|
private void Start()
|
|
|
{
|
|
{
|
|
|
controller = GetComponentInParent<PlayerController>();
|
|
controller = GetComponentInParent<PlayerController>();
|
|
@@ -19,19 +21,26 @@ public class Trans_Float : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
if (controller.isinputJ)
|
|
if (controller.isinputJ)
|
|
|
{
|
|
{
|
|
|
|
|
+ print(controller.attackToFloat);
|
|
|
controller.isinputJ = false;
|
|
controller.isinputJ = false;
|
|
|
if (isFirst)
|
|
if (isFirst)
|
|
|
{
|
|
{
|
|
|
- isFirst = false;
|
|
|
|
|
- //触发
|
|
|
|
|
|
|
+ if (!controller.attackToFloat)
|
|
|
|
|
+ {
|
|
|
|
|
+ isFirst = false;
|
|
|
|
|
+ controller.attackToFloat = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- times += 1;
|
|
|
|
|
- if (times >= minTime || times == maxTime)
|
|
|
|
|
|
|
+ if (!controller.attackToFloat)
|
|
|
{
|
|
{
|
|
|
- times = 0;
|
|
|
|
|
- //触发
|
|
|
|
|
|
|
+ times += 1;
|
|
|
|
|
+ if (times >= minTime || times == maxTime)
|
|
|
|
|
+ {
|
|
|
|
|
+ times = 0;
|
|
|
|
|
+ controller.attackToFloat = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
GetComponent<Demonic>().Attack2();
|
|
GetComponent<Demonic>().Attack2();
|