Merge branch 'develop' into bugfix/美术素材填充
This commit is contained in:
@@ -159,7 +159,7 @@ namespace AibisDream
|
||||
[YarnCommand("RetractCable")]
|
||||
public static void RetractCable()
|
||||
{
|
||||
CablePanel.PullUpCable();
|
||||
CablePanel?.PullUpCable();
|
||||
}
|
||||
|
||||
[YarnCommand("StartHeadBreathing")]
|
||||
|
||||
@@ -68,17 +68,17 @@ public class PhysicCable : MonoBehaviour
|
||||
[SerializeField] private string sortingLayerName = "Tools";
|
||||
[SerializeField] private int sortingOrder = 47;
|
||||
// 7/7 PixelCableLine step 色阶: Edge → Band Dark → Band Light
|
||||
// 体色 #00335f;暗部微偏红、亮部微偏黄(贴近 PS 暖调体积),高光约 75% 强度
|
||||
[SerializeField] private Color darkColor = new(0.032f, 0.085f, 0.155f, 1f); // 暗面偏暖红
|
||||
[SerializeField] private float darkWidth = 0.32f;
|
||||
[SerializeField] private Color bodyColor = new(0f, 0.2f, 0.373f, 1f); // #00335f
|
||||
[SerializeField] private float bodyWidth = 0.26f;
|
||||
[SerializeField] private Color midColor = new(0.038f, 0.238f, 0.345f, 1f); // 中间调微偏黄
|
||||
[SerializeField] private float midWidth = 0.082f;
|
||||
[SerializeField] private float midLift = 0.015f;
|
||||
[SerializeField] private Color highlightColor = new(0.056f, 0.248f, 0.298f, 1f); // ≈75% 叠在 mid 上的暖高光
|
||||
[SerializeField] private float highlightWidth = 0.02f;
|
||||
[SerializeField] private float highlightLift = 0.015f;
|
||||
// 暗面轻微偏红、亮面轻微偏黄;反光保持克制,避免线缆体积感过强。
|
||||
[SerializeField] private Color darkColor = new(0.02f, 0.05f, 0.09f, 1f); // Edge Outline,微偏红
|
||||
[SerializeField] private float darkWidth = 0.33f; // 原型:w+4
|
||||
[SerializeField] private Color bodyColor = new(0.035f, 0.135f, 0.19f, 1f); // Band Dark
|
||||
[SerializeField] private float bodyWidth = 0.26f; // 原型:w=15px ≈ 0.26wu
|
||||
[SerializeField] private Color midColor = new(0.095f, 0.255f, 0.275f, 1f); // Band Light,微偏黄
|
||||
[SerializeField] private float midWidth = 0.10f; // 收窄中亮面,减弱体积感
|
||||
[SerializeField] private float midLift = 0.028f;
|
||||
[SerializeField] private Color highlightColor = new(0.18f, 0.32f, 0.30f, 0.75f); // 高光透明度降低 25%
|
||||
[SerializeField] private float highlightWidth = 0.04f;
|
||||
[SerializeField] private float highlightLift = 0.05f;
|
||||
|
||||
[Header("端部收窄(默认关闭:整根线宽与插头/孔匹配)")]
|
||||
[SerializeField, Range(0f, 0.3f)] private float tipTaperFraction = 0f; // 末端收窄段占全长比例,0 关闭
|
||||
|
||||
@@ -326,8 +326,21 @@ public class ShockSystem : MonoBehaviour, IInteraction
|
||||
lastMousePosition = mousePosition;
|
||||
|
||||
float progressRatio = targetLeverAngle / maxLeverAngle;
|
||||
if (progressRatio <= 0f)
|
||||
{
|
||||
if (isCharging)
|
||||
{
|
||||
isCharging = false;
|
||||
ResetProgress();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (progressRatio > 0 && !isCharging)
|
||||
{
|
||||
progressTweener?.Kill();
|
||||
progressTweener = null;
|
||||
isCharging = true;
|
||||
StartCharging();
|
||||
AibisDream.Kit.AudioManager.Instance.PlaySfx(chargingEvent, chargingAudioKey);
|
||||
@@ -884,4 +897,4 @@ public class ShockLeverInteractionBridge : MonoBehaviour, IInteraction
|
||||
public bool IsActive => _shockSystem?.IsActive ?? true;
|
||||
public bool IsAvailable => _shockSystem?.IsAvailable ?? true;
|
||||
public GameObject GetGameObject() => gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@ namespace AibisDream.FixSystem
|
||||
#region 系统状态
|
||||
public bool isCableRetracted = true; // 线缆是否收起
|
||||
|
||||
// 与 isCableRetracted(当前可交互状态)分开记录最后一次指令的目标,
|
||||
// 防止相反方向或外部 DOKill 触发旧动画回调,把线缆恢复到错误状态。
|
||||
private bool targetCableRetracted = true;
|
||||
|
||||
[SerializeField] private Transform retractedPos; // 收起位置
|
||||
|
||||
private ISocket curSocket;
|
||||
@@ -86,6 +90,8 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void InitCableVisualFromPrefab()
|
||||
{
|
||||
targetCableRetracted = isCableRetracted;
|
||||
|
||||
if (isCableRetracted)
|
||||
{
|
||||
SetRetractCable();
|
||||
@@ -145,6 +151,8 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public void DropDownCableImmediate()
|
||||
{
|
||||
targetCableRetracted = false;
|
||||
PlugRef.transform.DOKill(false);
|
||||
PlugRef.PullUpSocketSilent();
|
||||
CableReelRef.ResetRotation();
|
||||
PlugRef.RestoreAtStartPositionImmediate();
|
||||
@@ -212,14 +220,25 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从插孔拔出(若已插入),放回初始可插线位:线缆放下、可拖拽,不收起。
|
||||
/// </summary>
|
||||
public void ResetPlug()
|
||||
{
|
||||
if (IsPlugInSocket())
|
||||
bool wasPlugged = IsPlugInSocket();
|
||||
if (wasPlugged)
|
||||
{
|
||||
PlugRef.PullUpSocket();
|
||||
}
|
||||
|
||||
BodyModuleSystem.CloseModuleSlots(null);
|
||||
|
||||
// 已在初始可插线位且未收起:只关槽,不重复放线/音效
|
||||
if (!wasPlugged && !isCableRetracted && !targetCableRetracted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DropDownCableImmediate();
|
||||
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mods_close");
|
||||
@@ -315,45 +334,71 @@ namespace AibisDream.FixSystem
|
||||
return BodyModuleSystem.TryFindClosestModule(sourcePos, out targetModule);
|
||||
}
|
||||
|
||||
/// <summary>收起线缆:无论是否插在模块上,统一收到线盘位。</summary>
|
||||
public void PullUpCable()
|
||||
{
|
||||
if (isCableRetracted) return;
|
||||
|
||||
if (IsPlugInSocket())
|
||||
bool wasPlugged = IsPlugInSocket();
|
||||
if (wasPlugged)
|
||||
{
|
||||
PlugRef.PullUpSocket();
|
||||
}
|
||||
|
||||
BodyModuleSystem.CloseModuleSlots(null);
|
||||
|
||||
// 收线动画:绳身按纯插值收拢到收纳位(不走拖拽物理,避免其阻尼参数在极短时长内来不及收敛而甩鞭),
|
||||
// 插头 DOMove 与绳收拢共用同一时长,动画结束时绳已真正收完,再切换到收起态不会有可见的切割感
|
||||
// 已在收起或正在收起,且本次无需拔插:不重复收线动画/音效
|
||||
if (targetCableRetracted && !wasPlugged)
|
||||
{
|
||||
isCableRetracted = true;
|
||||
return;
|
||||
}
|
||||
|
||||
targetCableRetracted = true;
|
||||
isCableRetracted = true;
|
||||
|
||||
PlugRef.transform.DOKill(false);
|
||||
|
||||
if (physicCableRef.State == PhysicCable.CableState.Hidden)
|
||||
{
|
||||
ApplyRetractedState();
|
||||
return;
|
||||
}
|
||||
|
||||
suppressPlugFollow = true;
|
||||
physicCableRef.CollapseTo(retractedPos.position, RetractDuration);
|
||||
PlugRef.transform.DOMove(retractedPos.position, RetractDuration)
|
||||
.OnComplete(() =>
|
||||
{
|
||||
ApplyRetractedState();
|
||||
isCableRetracted = true;
|
||||
});
|
||||
.OnComplete(CompleteRetractIfCurrent)
|
||||
.OnKill(CompleteRetractIfCurrent);
|
||||
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mods_close");
|
||||
AudioManager.Instance.PlaySfx("event:/FollowInput/plugdrop");
|
||||
}
|
||||
|
||||
private void CompleteRetractIfCurrent()
|
||||
{
|
||||
if (!targetCableRetracted) return;
|
||||
ApplyRetractedState();
|
||||
isCableRetracted = true;
|
||||
}
|
||||
|
||||
public void DropDownCable()
|
||||
{
|
||||
if (!isCableRetracted) return;
|
||||
// 确保 Plug 已脱离 Socket(收起状态下通常已脱离,此处为防御性调用)
|
||||
if (!isCableRetracted && !targetCableRetracted) return;
|
||||
|
||||
targetCableRetracted = false;
|
||||
PlugRef.PullUpSocket();
|
||||
PlugRef.transform.DOKill(false);
|
||||
CableReelRef.ResetRotation();
|
||||
suppressPlugFollow = true;
|
||||
PlugRef.transform.DOMove(PlugRef.GetStartPos(), 0.1f).OnComplete(() =>
|
||||
{
|
||||
suppressPlugFollow = false;
|
||||
physicCableRef.ShowFree(true);
|
||||
isCableRetracted = false;
|
||||
});
|
||||
PlugRef.transform.DOMove(PlugRef.GetStartPos(), 0.1f).OnComplete(CompleteDropIfCurrent)
|
||||
.OnKill(CompleteDropIfCurrent);
|
||||
}
|
||||
|
||||
private void CompleteDropIfCurrent()
|
||||
{
|
||||
if (targetCableRetracted) return;
|
||||
suppressPlugFollow = false;
|
||||
physicCableRef.ShowFree(true);
|
||||
isCableRetracted = false;
|
||||
}
|
||||
|
||||
/// <summary>应用收起状态的视觉与组件设置(不含动画、不含 isCableRetracted 更新)</summary>
|
||||
@@ -362,8 +407,6 @@ namespace AibisDream.FixSystem
|
||||
physicCableRef.Hide();
|
||||
suppressPlugFollow = false;
|
||||
|
||||
// 强制收起时长可能短于拔出反馈动画(挤压 punch scale),未播完就会被打断,
|
||||
// 收起完成后强制清掉,避免插头带着没播完的形变停在收纳位
|
||||
PlugRef.CancelFeedbackTween();
|
||||
|
||||
PlugRef.transform.position = retractedPos.position;
|
||||
@@ -376,8 +419,10 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public void SetRetractCable()
|
||||
{
|
||||
ApplyRetractedState();
|
||||
targetCableRetracted = true;
|
||||
isCableRetracted = true;
|
||||
PlugRef.transform.DOKill(false);
|
||||
ApplyRetractedState();
|
||||
}
|
||||
|
||||
#region 灯光系统 - 供外部调用
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.ResetPlug();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace AibisDream.FixSystem
|
||||
bodyModuleSystem.SwitchModuleGroup(moduleState);
|
||||
}
|
||||
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.ResetPlug();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule, true);
|
||||
|
||||
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.BodyModule);
|
||||
@@ -117,11 +117,8 @@ namespace AibisDream.FixSystem
|
||||
public IEnumerator Exit(FixTransition transition)
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
// 拔出插头
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
// 清屏
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
FixPanelSystem.Instance.ScreenPanel.ClearScreen();
|
||||
// 关闭交互
|
||||
bodyModuleSystem.DisableSystem();
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace AibisDream.FixSystem
|
||||
// Cut的气泡统一放在BodyModule下
|
||||
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Cut);
|
||||
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
var bodyModule = bodyModuleSystem.FindBodyModuleByName("Emo");
|
||||
if (bodyModule != null)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ namespace AibisDream.FixSystem
|
||||
// Cut的气泡统一放在BodyModule下
|
||||
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Cut);
|
||||
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
var bodyModule = bodyModuleSystem.FindBodyModuleByName("Memory");
|
||||
if (bodyModule != null)
|
||||
{
|
||||
@@ -117,6 +117,7 @@ namespace AibisDream.FixSystem
|
||||
// Cut的气泡统一放在BodyModule下
|
||||
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Cut);
|
||||
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
var bodyModule = bodyModuleSystem.FindBodyModuleByName("Logic");
|
||||
if (bodyModule != null)
|
||||
{
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace AibisDream.FixSystem
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(0.5f);
|
||||
|
||||
// 重置身体模块
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
// 离开表达深入:保持线缆收起,回到 BodyModule 后由 Yarn DropCable 再放线
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
|
||||
// 关闭表达系统视图
|
||||
expressionManager.CloseView();
|
||||
@@ -77,7 +77,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public IEnumerator Exit(FixTransition transition)
|
||||
{
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
@@ -98,8 +98,7 @@ namespace AibisDream.FixSystem
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
||||
}
|
||||
|
||||
// 插头回到初始插孔
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
|
||||
// 切换到分析模式相机
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(0.5f);
|
||||
|
||||
@@ -21,9 +21,7 @@ namespace AibisDream.FixSystem
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
||||
}
|
||||
|
||||
// 插头回到初始插孔
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
// 切换相机
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.UF);
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(0.5f);
|
||||
ufSystem.OpenUFView();
|
||||
@@ -65,9 +63,7 @@ namespace AibisDream.FixSystem
|
||||
var eyeModule = bodyModuleSystem.FindBodyModuleByType<EyeModule>();
|
||||
yield return eyeModule.OpenEye();
|
||||
|
||||
// 插头回到初始插孔
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
// 切换相机
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Eye);
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(0.5f);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.EyeDeep);
|
||||
@@ -118,9 +114,7 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
|
||||
yield return memorySystem.DropMemoryProjector();
|
||||
// 插头回到初始插孔
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Memory);
|
||||
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(duration);
|
||||
memorySystem.OnEnter();
|
||||
@@ -134,7 +128,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
FixPanelSystem.Instance.TaskPanel?.CollapsePanelTemporary(immediate: true);
|
||||
yield return memorySystem.DropMemoryProjector();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>().ResetPlug();
|
||||
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Memory, true);
|
||||
memorySystem.OnEnter();
|
||||
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Memory);
|
||||
|
||||
Reference in New Issue
Block a user