|
|
@@ -4,7 +4,6 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using TMPro;
|
|
|
-using System.Linq;
|
|
|
|
|
|
public class MoveCharacter : Character
|
|
|
{
|
|
|
@@ -26,15 +25,18 @@ public class MoveCharacter : Character
|
|
|
|
|
|
[Header("ÊôÐÔ")]
|
|
|
public float moveSpeed = 5;
|
|
|
+ public bool needToAdjustFlyHeight;
|
|
|
[DisplayOnly]
|
|
|
public float flyHeight;
|
|
|
public float maxFlyHeight;
|
|
|
public float minFlyHeight;
|
|
|
- public float flyUpSpeed = 10;
|
|
|
+ float refspeed = 1;
|
|
|
+ public float flyUpTime;
|
|
|
+ [HideInInspector]
|
|
|
+ public int isAdjustHeight;
|
|
|
|
|
|
[Header("ÐéÈõ״̬")]
|
|
|
- public float totalBeRepelValue;
|
|
|
-
|
|
|
+ public float totalBeRepelValue;
|
|
|
[HideInInspector]
|
|
|
public float beRepelValue;
|
|
|
public float weakTime;
|
|
|
@@ -316,17 +318,24 @@ public class MoveCharacter : Character
|
|
|
if (transform.position.y - flyHeight > 0.1f)
|
|
|
{
|
|
|
Vector3 pos = transform.position;
|
|
|
- pos.y -= flyUpSpeed * Time.deltaTime;
|
|
|
+ pos.y = Mathf.SmoothDamp(pos.y, flyHeight, ref refspeed, flyUpTime);
|
|
|
transform.position = pos;
|
|
|
return false;
|
|
|
}
|
|
|
else if (transform.position.y - flyHeight < -0.1f)
|
|
|
{
|
|
|
Vector3 pos = transform.position;
|
|
|
- pos.y += flyUpSpeed * Time.deltaTime;
|
|
|
+ pos.y = Mathf.SmoothDamp(pos.y, flyHeight, ref refspeed, flyUpTime);
|
|
|
transform.position = pos;
|
|
|
return false;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Vector3 pos = transform.position;
|
|
|
+ pos.y = flyHeight;
|
|
|
+ transform.position = pos;
|
|
|
+ isAdjustHeight = 2;
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
}
|