分辨率和UI问题修复
This commit is contained in:
@@ -29,11 +29,11 @@ MonoBehaviour:
|
||||
m_Items:
|
||||
- rid: 7917695930343620616
|
||||
- m_Id: 22296671555584
|
||||
m_Localized: SELECT LEVEL
|
||||
m_Localized: SELECT CHAPTER
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 22296671555585
|
||||
m_Localized: LOAD GAME
|
||||
m_Localized: SELECT CHAPTER
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 22296675749888
|
||||
|
||||
@@ -20,7 +20,7 @@ MonoBehaviour:
|
||||
- rid: 7917695939544875419
|
||||
m_TableData:
|
||||
- m_Id: 3350325104640
|
||||
m_Localized: "\u5F00\u59CB\u6E38\u620F"
|
||||
m_Localized: "\u65B0\u6E38\u620F"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 22296654778368
|
||||
@@ -29,11 +29,11 @@ MonoBehaviour:
|
||||
m_Items:
|
||||
- rid: 7917695939544875419
|
||||
- m_Id: 22296671555584
|
||||
m_Localized: "\u9009\u62E9\u5173\u5361"
|
||||
m_Localized: "\u9009\u62E9\u7AE0\u8282"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 22296671555585
|
||||
m_Localized: "\u52A0\u8F7D\u5B58\u6863"
|
||||
m_Localized: "\u9009\u62E9\u7AE0\u8282"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 22296675749888
|
||||
|
||||
+29
-1580
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
public class CableSystem : MonoBehaviour
|
||||
{
|
||||
private const string CABLE_RETRACTED_KEY = "$global.cableRetracted";
|
||||
private const string CableRetractedKey = "$global.cableRetracted";
|
||||
|
||||
#region 组件索引
|
||||
|
||||
@@ -59,8 +59,7 @@ namespace AibisDream.FixSystem
|
||||
DialogController.OnDialogueStart -= HandleDialogueStart;
|
||||
DialogController.OnDialogueComplete -= HandleDialogueComplete;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void InitComponentRefs()
|
||||
{
|
||||
PlugRef = transform.Find("Plug").GetComponent<Plug>();
|
||||
@@ -86,7 +85,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void LoadCableState()
|
||||
{
|
||||
if (StorageSystem.Instance.TryGetValue(CABLE_RETRACTED_KEY, out bool savedRetractedState))
|
||||
if (StorageSystem.Instance.TryGetValue(CableRetractedKey, out bool savedRetractedState))
|
||||
{
|
||||
if (isCableRetracted)
|
||||
{
|
||||
@@ -108,7 +107,7 @@ namespace AibisDream.FixSystem
|
||||
private void SaveCableState()
|
||||
{
|
||||
Debug.Log("Save cableRetractedstate" + isCableRetracted);
|
||||
StorageSystem.Instance.SetValue(CABLE_RETRACTED_KEY, isCableRetracted);
|
||||
StorageSystem.Instance.SetValue(CableRetractedKey, isCableRetracted);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -150,6 +149,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void HandleDialogueComplete()
|
||||
{
|
||||
Debug.Log("Dialog End");
|
||||
isInDialog = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Shapes;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.VFX;
|
||||
@@ -94,10 +93,7 @@ public class GearFollower : MonoBehaviour
|
||||
private Vector3 targetPosition = Vector3.zero;
|
||||
private bool isInTractionMode = false;
|
||||
private bool isDrillSfxPlaying = false; // 标记音效是否已播放
|
||||
|
||||
void Start()
|
||||
{
|
||||
}
|
||||
|
||||
public void Init(SpriteRenderer targetSpriteRenderer)
|
||||
{
|
||||
SpriteRenderer gearRenderer = GetComponent<SpriteRenderer>();
|
||||
@@ -145,10 +141,7 @@ public class GearFollower : MonoBehaviour
|
||||
sparkVFX.Stop();
|
||||
}
|
||||
}
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void GearUpdate()
|
||||
{
|
||||
// 获取鼠标在屏幕上的位置
|
||||
@@ -156,16 +149,7 @@ public class GearFollower : MonoBehaviour
|
||||
// 将屏幕坐标转换为世界坐标
|
||||
Vector3 mouseWorldPos = mainCamera.ScreenToWorldPoint(new Vector3(mouseScreenPos.x, mouseScreenPos.y, -mainCamera.transform.position.z));
|
||||
mouseWorldPos.z = 0; // 确保z坐标为0
|
||||
|
||||
Debug.Log($"鼠标屏幕坐标: {mouseScreenPos}");
|
||||
Debug.Log($"鼠标世界坐标: {mouseWorldPos}");
|
||||
Debug.Log($"齿轮当前位置: {transform.position}");
|
||||
if (targetSpriteRenderer != null)
|
||||
{
|
||||
Debug.Log($"目标精灵位置: {targetSpriteRenderer.transform.position}");
|
||||
Debug.Log($"目标精灵边界: {targetSpriteRenderer.bounds}");
|
||||
}
|
||||
|
||||
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
transform.Rotate(Vector3.forward, -360f * Time.deltaTime);
|
||||
@@ -311,17 +295,13 @@ public class GearFollower : MonoBehaviour
|
||||
worldPoint1 = ClampPosition(worldPoint1, spriteWorldPos, maxScale);
|
||||
worldPoint2 = ClampPosition(worldPoint2, spriteWorldPos, maxScale);
|
||||
|
||||
Debug.Log($"点 {i} 局部坐标: {localPoint1} -> 世界坐标: {worldPoint1}");
|
||||
|
||||
// 计算相对于精灵中心点的缩放
|
||||
Vector3 scaledPoint1 = spriteWorldPos + (worldPoint1 - spriteWorldPos) * edgePointsScale;
|
||||
Vector3 scaledPoint2 = spriteWorldPos + (worldPoint2 - spriteWorldPos) * edgePointsScale;
|
||||
|
||||
// 确保缩放后的点也在合理范围内
|
||||
scaledPoint1 = ClampPosition(scaledPoint1, spriteWorldPos, maxScale);
|
||||
scaledPoint2 = ClampPosition(scaledPoint2, spriteWorldPos, maxScale);
|
||||
|
||||
Debug.Log($"点 {i} 缩放后世界坐标: {scaledPoint1}");
|
||||
scaledPoint2 = ClampPosition(scaledPoint2, spriteWorldPos, maxScale); ;
|
||||
|
||||
float segmentLength = Vector3.Distance(scaledPoint1, scaledPoint2);
|
||||
int steps = Mathf.Max(1, Mathf.CeilToInt(segmentLength / desiredSegmentLength));
|
||||
@@ -384,11 +364,9 @@ public class GearFollower : MonoBehaviour
|
||||
|
||||
Vector2 prev = edgePoints[WrapIndex(currentEdgeIndex - 1)];
|
||||
Vector2 next = edgePoints[WrapIndex(currentEdgeIndex + 1)];
|
||||
Debug.Log($"前一个点: {prev}, 后一个点: {next}");
|
||||
|
||||
float distToPrev = Vector2.Distance(mousePos, prev);
|
||||
float distToNext = Vector2.Distance(mousePos, next);
|
||||
Debug.Log($"到前一个点距离: {distToPrev}, 到后一个点距离: {distToNext}");
|
||||
|
||||
tractionDirection = (distToNext < distToPrev) ? 1 : -1;
|
||||
|
||||
@@ -555,9 +533,6 @@ public class GearFollower : MonoBehaviour
|
||||
{
|
||||
visiblePoints.Add(timedPoint.position);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
cutLineRenderer.positionCount = visiblePoints.Count;
|
||||
@@ -640,7 +615,6 @@ public class GearFollower : MonoBehaviour
|
||||
{
|
||||
totalEdgeLength += Vector2.Distance(edgePoints[i], edgePoints[i + 1]);
|
||||
}
|
||||
Debug.Log($"计算总边缘长度: {totalEdgeLength}");
|
||||
}
|
||||
|
||||
private void UpdateCutProgress(Vector2 from, Vector2 to)
|
||||
@@ -654,7 +628,6 @@ public class GearFollower : MonoBehaviour
|
||||
|
||||
// 计算切割进度
|
||||
float progress = cutLength / totalEdgeLength;
|
||||
Debug.Log($"当前切割长度: {cutLength}, 总长度: {totalEdgeLength}, 进度: {progress * 100}%");
|
||||
|
||||
// 更新切割进度
|
||||
var cuttingManager = FixSystemCenter.SystemDic.Get<CuttingManager>();
|
||||
@@ -926,11 +899,6 @@ public class GearFollower : MonoBehaviour
|
||||
// 停止音效的辅助方法
|
||||
private void StopDrillSfxIfPlaying()
|
||||
{
|
||||
var audioManager = AibisDream.Kit.AudioManager.Instance;
|
||||
if (audioManager != null)
|
||||
{
|
||||
audioManager.StopSfx("event:/FollowInput/drill");
|
||||
|
||||
}
|
||||
AudioManager.Instance?.StopSfx("event:/FollowInput/drill");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,20 +191,17 @@ namespace AibisDream
|
||||
{
|
||||
case "FullScreen":
|
||||
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, FullScreenMode.FullScreenWindow);
|
||||
CameraKit.Instance.UpdateCameraViewport();
|
||||
break;
|
||||
case "Windowed":
|
||||
Screen.SetResolution(1920, 1080, FullScreenMode.Windowed);
|
||||
CameraKit.Instance.UpdateCameraViewport();
|
||||
break;
|
||||
case "MaximizedWindow":
|
||||
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, FullScreenMode.MaximizedWindow);
|
||||
CameraKit.Instance.UpdateCameraViewport();
|
||||
break;
|
||||
default:
|
||||
Debug.Log($"{windowMode} err");
|
||||
break;
|
||||
}
|
||||
|
||||
ActionKit.DelayFrame(1, () => CameraKit.Instance.UpdateCameraViewport());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace AibisDream
|
||||
{
|
||||
Debug.Log("[对话继续] 延迟隐藏对话框");
|
||||
_hideDialog = null;
|
||||
view.HideDialog();
|
||||
view?.HideDialog();
|
||||
}).Start(this);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace AibisDream
|
||||
// 开始界面按钮
|
||||
var tabs = transform.Find("Tabs");
|
||||
tabs.Find("Start").GetComponent<Button>().onClick.AddListener(StartNewGame);
|
||||
tabs.Find("Select Level").GetComponent<Button>().onClick.AddListener(OpenLevelPanel);
|
||||
tabs.Find("Load Save File").GetComponent<Button>().onClick.AddListener(OpenSaveFilePanel);
|
||||
tabs.Find("Setting").GetComponent<Button>().onClick.AddListener(OpenSetting);
|
||||
tabs.Find("Quit").GetComponent<Button>().onClick.AddListener(QuitApp);
|
||||
@@ -46,15 +45,13 @@ namespace AibisDream
|
||||
var others = transform.Find("Others");
|
||||
others.Find("问卷").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
string currentLanguage = "zh-Hans";
|
||||
SettingLoader.Instance.TryRead("Language", out currentLanguage);
|
||||
SettingLoader.Instance.TryRead("Language", out var currentLanguage);
|
||||
var url = currentLanguage == "zh-Hans" ? ConstRef.SurveyURL_CN : ConstRef.SurveyURL_EN;
|
||||
Application.OpenURL(url);
|
||||
});
|
||||
others.Find("关注").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
string currentLanguage = "zh-Hans";
|
||||
SettingLoader.Instance.TryRead("Language", out currentLanguage);
|
||||
SettingLoader.Instance.TryRead("Language", out var currentLanguage);
|
||||
var url = currentLanguage == "zh-Hans" ? ConstRef.QQURL : ConstRef.DiscordURL;
|
||||
Application.OpenURL(url);
|
||||
});
|
||||
@@ -73,11 +70,6 @@ namespace AibisDream
|
||||
GameManager.Instance.StartNewGame();
|
||||
}
|
||||
|
||||
private void OpenLevelPanel()
|
||||
{
|
||||
// TODO 打开选关面板
|
||||
}
|
||||
|
||||
private void OpenSaveFilePanel()
|
||||
{
|
||||
UIManager.Instance.ShowPanel<ChapterPanel>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"Volume": "0.89",
|
||||
"Language": "en",
|
||||
"WindowMode": "Windowed"
|
||||
"Language": "zh-Hans",
|
||||
"WindowMode": "FullScreen"
|
||||
}
|
||||
@@ -133,7 +133,7 @@ PlayerSettings:
|
||||
vulkanEnableLateAcquireNextImage: 0
|
||||
vulkanEnableCommandBufferRecycling: 1
|
||||
loadStoreDebugModeEnabled: 0
|
||||
bundleVersion: 0.3.2.17-20250904-152447
|
||||
bundleVersion: 0.3.2.18-20250908-145437
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: 0fb2bc2476953fc43a74f0ab8879077c, type: 2}
|
||||
metroInputSource: 0
|
||||
|
||||
Reference in New Issue
Block a user