Commit ee0428d5 authored by hex's avatar hex

fix side change error

parent 8417d3d7
Pipeline #38501 failed
...@@ -213,12 +213,29 @@ public class MonoCardInDeckManager : MonoBehaviour ...@@ -213,12 +213,29 @@ public class MonoCardInDeckManager : MonoBehaviour
public bool getIfAlive() public bool getIfAlive()
{ {
// 步骤 1: 检查不可逆的“死亡”状态,这在任何模式下都适用。
if (died || gameObject.transform.position.y < -0.5f) if (died || gameObject.transform.position.y < -0.5f)
{
return false; return false;
}
// 步骤 2: 根据 DeckManager 的当前状态执行不同的逻辑。
if (Program.I().deckManager.condition == DeckManager.Condition.changeSide)
{
// 换 side 的时候,不会死亡
return true;
}
else // (condition == DeckManager.Condition.editDeck)
{
// 在“编辑卡组”模式下,我们执行原有的严格边界检查。
// 将卡片拖到边界外意味着“丢弃”。
Vector3 to_ltemp = refLectPosition(gameObject.transform.position); Vector3 to_ltemp = refLectPosition(gameObject.transform.position);
if (to_ltemp.x < -15.2f || to_ltemp.x > 15.2f) if (to_ltemp.x < -15.2f || to_ltemp.x > 15.2f)
{
return false; return false;
return Program.I().deckManager.condition == DeckManager.Condition.changeSide || true; }
}
// 如果通过了所有检查,则卡片是存活的。
return true;
} }
public static Vector3 refLectPosition(Vector3 pos) public static Vector3 refLectPosition(Vector3 pos)
......
...@@ -300,8 +300,9 @@ public class selectReplay : WindowServantSP ...@@ -300,8 +300,9 @@ public class selectReplay : WindowServantSP
RMSshow_none(InterString.Get("录像没有录制完整。")); RMSshow_none(InterString.Get("录像没有录制完整。"));
} }
} }
catch (Exception) catch (Exception e)
{ {
UnityEngine.Debug.Log(e);
RMSshow_none(InterString.Get("录像没有录制完整。")); RMSshow_none(InterString.Get("录像没有录制完整。"));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment