美术资源替换

This commit is contained in:
2025-06-14 22:59:52 +08:00
parent cde651f0ff
commit 36643009bb
34 changed files with 2318 additions and 2136 deletions
@@ -129,26 +129,28 @@ namespace AibisDream.FixSystem
targetModule = null;
res = false;
}
HandleModuleSlotState(targetModule);
return res;
}
private void HandleModuleSlotState([CanBeNull]BodyModule closestModule)
public void OpenModuleSlots()
{
foreach (var bodyModule in BodyModules)
foreach (var module in BodyModules)
{
if (closestModule && bodyModule == closestModule)
module.OpenPlugSlot();
}
}
public void CloseModuleSlots([CanBeNull] BodyModule curModule)
{
foreach (var module in BodyModules)
{
if (module != curModule)
{
bodyModule.OpenPlugSlot();
}
else
{
bodyModule.ClosePlugSlot();
module.ClosePlugSlot();
}
}
}
/// <summary>
/// 寻找指定名称的BodyModule
/// </summary>
@@ -18,12 +18,13 @@ namespace AibisDream
var cutModule = BodyModuleSystem.FindBodyModuleByName(moduleName);
//cutModule.EnableCut();
}
[YarnCommand("Reset_Plug")]
public static void Reset_Plug()
{
BodyModuleSystem.CableSystem.ResetPlug();
}
[YarnCommand("ShowHeatMap")]
public static void ShowHeatMap()
{
@@ -137,11 +138,13 @@ namespace AibisDream
{
yield return PunchTapeSystem.StartCoroutine(PunchTapeSystem.PrintPunchTapes(count));
}
[YarnCommand("DropCable")]
public static void DropCable()
{
BodyModuleSystem.CableSystem.DropDownCable();
}
[YarnCommand("RetractCable")]
public static void RetractCable()
{
@@ -1,7 +1,5 @@
using UnityEngine;
using DG.Tweening;
using System;
using AibisDream;
namespace AibisDream.FixSystem
{
@@ -125,6 +123,7 @@ namespace AibisDream.FixSystem
{
// 不在初始插孔里,就从当前插孔拔出来,插回初始插孔
PlugRef.PullUpSocket();
BodyModuleSystem.CloseModuleSlots(null);
PlugRef.ReturnToStartPosition();
}
+7 -10
View File
@@ -4,7 +4,6 @@ using AibisDream.Utility;
using DG.Tweening;
using UnityEngine;
using UnityEngine.EventSystems;
using Yarn;
namespace AibisDream.FixSystem
{
@@ -16,8 +15,7 @@ namespace AibisDream.FixSystem
#region
private Vector3 _startPos;
private Vector3 _RetractedPos;
private readonly Vector3 _pickupOffset = new(0, 0, 0);
private readonly Quaternion _pickupRotationOffset = Quaternion.Euler(0, 0, 30);
private readonly Quaternion _initRotation = Quaternion.Euler(0, 0, 180);
@@ -40,7 +38,6 @@ namespace AibisDream.FixSystem
{
InitComponentRef();
EventRegister();
_RetractedPos = transform.position;
_startPos = new Vector3(transform.position.x + 0.3f, transform.position.y - 2f,
transform.position.z); // 初始化时记录初始位置
}
@@ -134,13 +131,11 @@ namespace AibisDream.FixSystem
private void OnPointerDown(BaseEventData eventData)
{
Debug.Log($"OnPointerDown - IsPlugAvailable: {_cableSystem.IsPlugAvailable()}, isDragging: {_isDragging}");
GetComponent<SpriteRenderer>().sortingLayerName = "Tools";
GetComponent<SpriteRenderer>().sortingOrder = 48;
// 系统被锁定就返回
if (!_cableSystem.IsPlugAvailable()) return;
// 首次拖拽后关闭高亮
if (GlobalVariableKit.IsPlugHighLight)
{
@@ -162,6 +157,9 @@ namespace AibisDream.FixSystem
_cableSystem.PhysicCableRef.GetComponent<LineRenderer>().enabled = false;
_isPhysicCableActive = false;
_cableSystem.CableRef.ShowCable();
// 打开所有模块
FixSystemCenter.SystemDic.Get<BodyModuleSystem>().OpenModuleSlots();
}
private void OnPointerUp(BaseEventData eventData)
@@ -174,11 +172,13 @@ namespace AibisDream.FixSystem
{
// 找到了就插入目标Module
InsertSocket(targetModule);
FixSystemCenter.SystemDic.Get<BodyModuleSystem>().CloseModuleSlots(targetModule);
}
else
{
// 没找到就回到初始位置
ReturnToStartPosition();
FixSystemCenter.SystemDic.Get<BodyModuleSystem>().CloseModuleSlots(null);
}
}
@@ -223,9 +223,6 @@ namespace AibisDream.FixSystem
{
_cableSystem.PhysicCableRef.physicLine.UpdatePlug(transform);
}
// 如果未锁定,就一直查询是否靠近最近的插孔
if (!_cableSystem.IsPlugAvailable()) return;
_cableSystem.TryFindClosestModule(transform.position, out _);
}
void OnDrawGizmosSelected()