1
This commit is contained in:
1 parent
329ff2c8e9
commit
eee5c83cb3
52 files changed
+11420
-24307
No files matched your search
@@ -6,6 +6,13 @@ public class CameraFollow : MonoBehaviour
|
||||
public Vector3 offset; // 摄像机相对于角色的偏移量
|
||||
public float smoothSpeed = 0.125f; // 摄像机移动的平滑速度
|
||||
|
||||
[Header("边界限制")]
|
||||
public bool enableBounds = true; // 是否启用边界限制
|
||||
public float minX = -6f; // X轴最小边界
|
||||
public float maxX = 6f; // X轴最大边界
|
||||
public float minZ = -30f; // Z轴最小边界(摄像机位置,不是主角位置)
|
||||
public float maxZ = 91f; // Z轴最大边界(摄像机位置,不是主角位置)
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (target == null)
|
||||
@@ -14,6 +21,14 @@ public class CameraFollow : MonoBehaviour
|
||||
}
|
||||
|
||||
Vector3 desiredPosition = target.position + offset;
|
||||
|
||||
// 边界限制:摄像机停在边界处,主角可以继续移动
|
||||
if (enableBounds)
|
||||
{
|
||||
desiredPosition.x = Mathf.Clamp(desiredPosition.x, minX, maxX);
|
||||
desiredPosition.z = Mathf.Clamp(desiredPosition.z, minZ, maxZ);
|
||||
}
|
||||
|
||||
transform.position = Vector3.Lerp(
|
||||
transform.position,
|
||||
desiredPosition,
|
||||
|
||||
@@ -28,9 +28,9 @@ public class MainCharacterCombat : MonoBehaviour
|
||||
public float summonDistance = 1.5f;
|
||||
public float summonSideOffset = 0.8f;
|
||||
public float summonSearchStep = 0.8f;
|
||||
public int summonSearchCount = 5;
|
||||
public int summonSearchCount = 8; // 增加左右搜索次数:5→8
|
||||
public float summonDepthSearchStep = 1f;
|
||||
public int summonDepthSearchCount = 2;
|
||||
public int summonDepthSearchCount = 3; // 增加前后搜索次数:2→3
|
||||
public float summonAnimationTimeout = 2.5f;
|
||||
|
||||
[Min(0f)]
|
||||
@@ -210,7 +210,14 @@ public class MainCharacterCombat : MonoBehaviour
|
||||
Vector3 spawnPosition;
|
||||
if (!TryFindSummonPosition(direction, out spawnPosition))
|
||||
{
|
||||
Debug.LogWarning("主角附近没有可用的召唤位置,本次召唤取消");
|
||||
Debug.LogWarning("主角附近没有可用的召唤位置,本次召唤取消,退还能量");
|
||||
|
||||
// 退还能量豆
|
||||
if (ManaSystem.Instance != null && pendingSummonCharacterData != null)
|
||||
{
|
||||
ManaSystem.Instance.AddMana(pendingSummonCharacterData.manaCost);
|
||||
}
|
||||
|
||||
FinishSummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,10 +91,28 @@ public class SummonCardButton : MonoBehaviour
|
||||
|
||||
private void UpdateCooldownUI()
|
||||
{
|
||||
bool canAfford = CanAfford();
|
||||
|
||||
if (cooldownMask != null)
|
||||
{
|
||||
cooldownMask.fillAmount = isOnCooldown ? (cooldownTimer / GetCooldownTime()) : 0f;
|
||||
cooldownMask.enabled = isOnCooldown;
|
||||
// CD中显示CD进度,能量不足时显示满遮罩
|
||||
if (isOnCooldown)
|
||||
{
|
||||
cooldownMask.fillAmount = cooldownTimer / GetCooldownTime();
|
||||
cooldownMask.enabled = true;
|
||||
}
|
||||
else if (!canAfford)
|
||||
{
|
||||
// 能量不足:显示满遮罩
|
||||
cooldownMask.fillAmount = 1f;
|
||||
cooldownMask.enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 可用状态:隐藏遮罩
|
||||
cooldownMask.fillAmount = 0f;
|
||||
cooldownMask.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (cooldownText != null)
|
||||
|
||||
Reference in new issue
Block a user