Merge branch '重构佩佩的脚本来配合存档' into bugfix/merge
This commit is contained in:
@@ -14,6 +14,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public Transform socketPos;
|
||||
|
||||
// public Transform _indicatorPos;
|
||||
private BodyModuleSystem _bodyModuleSystem;
|
||||
private Material _highlightMaterial;
|
||||
private Material _alarmMaterial;
|
||||
@@ -58,24 +59,26 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public void PlugIn()
|
||||
{
|
||||
// 插入就在示波器显示图片
|
||||
if (!_bodyModuleSystem.inHotErr)
|
||||
{
|
||||
StartCoroutine(FixSystemCenter.SystemDic.Get<IOscilloscopeSystem>()
|
||||
?.ShowScanImage(data.ScreenPic, data.checkPoints));
|
||||
}
|
||||
|
||||
// 然后触发Yarn节点
|
||||
DialogController.Instance?.StartDialogNode(_bodyModuleSystem.inHotErr ? "系统过热" : data.PlugInNodeName);
|
||||
if (DialogController.Instance)
|
||||
// 然后触发Yarn节点
|
||||
DialogController.Instance.StartDialogNode(_bodyModuleSystem.inHotErr ? "系统过热" : data.PlugInNodeName);
|
||||
}
|
||||
|
||||
public void PlugOut()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Get<IOscilloscopeSystem>()?.HideScanImage();
|
||||
|
||||
_bodyModuleSystem.oscilloscopeSystem.MessageBoxSetNull();
|
||||
StartCoroutine(_bodyModuleSystem.oscilloscopeSystem.DisableDeepInButton());
|
||||
|
||||
// TODO 触发Yarn节点(似乎目前没有拔出对话?)
|
||||
}
|
||||
|
||||
public void DeepIn()
|
||||
{
|
||||
if(DialogController.Instance)
|
||||
DialogController.Instance.StartDialogNode(data.DeepInNodeName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Vector3 GetSocketPos()
|
||||
{
|
||||
@@ -138,6 +141,14 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
// public void HideModule(bool enable)
|
||||
// {
|
||||
// if (targetSpriteRenderer != null && highlightMaterial != null)
|
||||
// {
|
||||
// targetSpriteRenderer.material = enable ? highlightMaterial : originalMaterial;
|
||||
// }
|
||||
// }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -145,6 +156,7 @@ namespace AibisDream.FixSystem
|
||||
public struct BodyModuleData
|
||||
{
|
||||
public const string PlugInNodeTemplate = "{0}PlugIn";
|
||||
public const string DeepInTemplate = "{0}DeepIn";
|
||||
|
||||
// ID
|
||||
public string moduleName;
|
||||
@@ -154,14 +166,11 @@ namespace AibisDream.FixSystem
|
||||
public SerializableVector3 modulePos;
|
||||
public SerializableVector3 socketPos;
|
||||
|
||||
// 功能信息
|
||||
[Header("功能参数")] public bool cantStopRunning;
|
||||
|
||||
public string showPicPath;
|
||||
public CheckPoint[] checkPoints;
|
||||
public bool cantStopRunning;
|
||||
|
||||
// 只读
|
||||
[JsonIgnore] public string PlugInNodeName => string.Format(PlugInNodeTemplate, moduleName);
|
||||
[JsonIgnore] public string DeepInNodeName => string.Format(DeepInTemplate, moduleName);
|
||||
|
||||
[JsonIgnore]
|
||||
public Sprite ModulePic
|
||||
@@ -170,9 +179,6 @@ namespace AibisDream.FixSystem
|
||||
set => modulePicPath = ResourceKit.SaveSprite(value);
|
||||
}
|
||||
|
||||
public Sprite ScreenPic =>
|
||||
!string.IsNullOrEmpty(showPicPath) ? ResourceKit.LoadSpriteFromPsd(showPicPath) : null;
|
||||
|
||||
[JsonIgnore]
|
||||
public Vector3 ModulePos
|
||||
{
|
||||
@@ -187,18 +193,4 @@ namespace AibisDream.FixSystem
|
||||
set => socketPos = new SerializableVector3(value);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct CheckPoint
|
||||
{
|
||||
public string id;
|
||||
private SerializableVector3 _serializablePos3;
|
||||
|
||||
[JsonIgnore]
|
||||
public Vector3 PointPos
|
||||
{
|
||||
get => _serializablePos3.ToVector3();
|
||||
set => _serializablePos3 = new SerializableVector3(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,6 +183,14 @@ namespace AibisDream.FixSystem
|
||||
CableSystem.ResetPlug();
|
||||
}
|
||||
|
||||
public void HandleDeepIn()
|
||||
{
|
||||
if (CableSystem.curBodyModule)
|
||||
{
|
||||
CableSystem.curBodyModule.DeepIn();
|
||||
}
|
||||
}
|
||||
|
||||
#region 数据加载与保存
|
||||
|
||||
public override string GetConfigPath()
|
||||
|
||||
@@ -10,7 +10,7 @@ public class ChipModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _chipModule;
|
||||
|
||||
private ChipData _chipData = new();
|
||||
private ChipData _chipData=new ();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -22,6 +22,7 @@ public class ChipModule : MonoBehaviour
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
|
||||
public void RemoveChipModule()
|
||||
{
|
||||
if (_chipModule.activeInHierarchy)
|
||||
|
||||
@@ -7,7 +7,7 @@ public class UFModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _ufCover;
|
||||
private GameObject _ufModule;
|
||||
private UFData _ufData;
|
||||
private UFData _ufData=new ();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -16,7 +16,7 @@ public class UFModule : MonoBehaviour
|
||||
// 添加加载逻辑
|
||||
_ufData.LoadEvent += LoadData;
|
||||
_ufModule = transform.Find("Module Pic").gameObject;
|
||||
_ufCover = transform.Find("Cover").gameObject;
|
||||
_ufCover = _ufModule.transform.Find("Cover").gameObject;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace AibisDream.FixSystem
|
||||
_state = transform.Find("Screen State Text").GetComponent<TMP_Text>();
|
||||
_deepinButton = new SpriteButton(transform.Find("Deepin Button").gameObject, false);
|
||||
MessageBoxSetNull();
|
||||
|
||||
_deepinButton.OnButtonDown += HandleDeepInButtonClick;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -43,6 +45,11 @@ namespace AibisDream.FixSystem
|
||||
_state.color = Color.red; // 红色
|
||||
}
|
||||
|
||||
private void HandleDeepInButtonClick()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Get<BodyModuleSystem>().HandleDeepIn();
|
||||
}
|
||||
|
||||
public void MessageBoxSetWarning()
|
||||
{
|
||||
_state.text = "警告";
|
||||
|
||||
Reference in New Issue
Block a user