diff --git a/Assets/Scripts/MiniGame/Engine/AirGate.cs b/Assets/Scripts/MiniGame/Engine/AirGate.cs index a6b1f13cc..6265c5af0 100644 --- a/Assets/Scripts/MiniGame/Engine/AirGate.cs +++ b/Assets/Scripts/MiniGame/Engine/AirGate.cs @@ -30,7 +30,6 @@ namespace AibisDream { SwitchAirLevel(mousePos.y); UpdateTransform(); - _engineSystem.UpdateAirLevel(curLevel); } private void UpdateTransform() @@ -45,13 +44,14 @@ namespace AibisDream mouseY -= _offset.y; float levelHeight = heightY / _engineSystem.config.maxLevel; - curLevel = (int)((mouseY) / levelHeight); + curLevel = (int)(mouseY / levelHeight); if (curLevel >= _engineSystem.config.maxLevel) curLevel = _engineSystem.config.maxLevel - 1; if (curLevel < 0) curLevel = 0; } public void StopMove() { + _engineSystem.UpdateAirLevel(curLevel); } } } diff --git a/Assets/Scripts/MiniGame/Engine/EngineSystem.cs b/Assets/Scripts/MiniGame/Engine/EngineSystem.cs index 64efdd6eb..f36195c1b 100644 --- a/Assets/Scripts/MiniGame/Engine/EngineSystem.cs +++ b/Assets/Scripts/MiniGame/Engine/EngineSystem.cs @@ -57,7 +57,7 @@ namespace AibisDream engineData.CalcSpeed(config.acceleratedSpeed, config.resistance); // 判断是否成功 if (engineData.CheckSuccess(config.targetSpeed)) - {; + { DialogController.Instance?.StartDialogNode("EngineSuccess"); } } @@ -81,6 +81,8 @@ namespace AibisDream public void UpdateAirLevel(int curLevel) { engineData.UpdateAirLevel(curLevel, config.maxLevel); + DialogController.Instance.SetVariable("$curAirLevel", curLevel + 1); + DialogController.Instance.StartDialogNode("调整进气档位"); } /// @@ -269,8 +271,13 @@ namespace AibisDream curAir = curOil; // 如果离开范围且当前在系统有效期,就进入一段失效期 var curInAirRange = curAir <= curAirMax && curAir >= curAirMin; - if (inAirRange && !curInAirRange && isValid.Value) + + if (inAirRange && !curInAirRange && !isSuccess) { + // 出界的话 + if (curAir > curAirMax) DialogController.Instance.StartDialogNode("调速popup-过速"); + if (curAir < curAirMin) DialogController.Instance.StartDialogNode("调速popup-掉速"); + isValid.Value = false; } diff --git a/Assets/Scripts/MiniGame/Gear/Shaft.cs b/Assets/Scripts/MiniGame/Gear/Shaft.cs index f1ad00d23..d3aa38c54 100644 --- a/Assets/Scripts/MiniGame/Gear/Shaft.cs +++ b/Assets/Scripts/MiniGame/Gear/Shaft.cs @@ -284,6 +284,8 @@ namespace AibisDream public float targetSpeed; public bool hasChildGear; public float radius; + public float isGearBroken; + public float brokenAngle; // 外形数据 public SerializableVector3 shaftPos; diff --git a/Assets/Scripts/MiniGame/Gear/ShaftGraph.cs b/Assets/Scripts/MiniGame/Gear/ShaftGraph.cs index 27342226d..1e7d47f7f 100644 --- a/Assets/Scripts/MiniGame/Gear/ShaftGraph.cs +++ b/Assets/Scripts/MiniGame/Gear/ShaftGraph.cs @@ -7,16 +7,12 @@ namespace AibisDream { // 顶点数量 private readonly int _vertexSize; - // 顶点Map private readonly Shaft[] _vertexArray; - // 邻接表 private float[,] _edgeTable; - // 遍历记录 private readonly bool[] _vertexRecordArray; - // 动力轴序号 private readonly int _rootIdx; @@ -252,5 +248,11 @@ namespace AibisDream return isShaftAvailable; } + + + public void AddDriverSpeed(float curSpeed) + { + + } } } \ No newline at end of file