130 lines
3.1 KiB
C#
130 lines
3.1 KiB
C#
using System.Collections;
|
|
using AibisDream.FixSystem;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream.Framework
|
|
{
|
|
public class CoolingSystem : MonoBehaviour, ICoolingSystem
|
|
{
|
|
#region 引用
|
|
|
|
private PumpController _pumpUI;
|
|
private BottleShelf _bottomUI;
|
|
private TubeController _tubeUI;
|
|
|
|
#endregion
|
|
|
|
#region 状态
|
|
|
|
public bool isLocked;
|
|
|
|
#endregion
|
|
|
|
public CoolingBottle curBottle;
|
|
|
|
private void Awake()
|
|
{
|
|
FixSystemCenter.SystemDic.Register(this);
|
|
InitRefs();
|
|
}
|
|
|
|
private void InitRefs()
|
|
{
|
|
_pumpUI = transform.Find("Pump Part").GetComponent<PumpController>();
|
|
_bottomUI = transform.Find("Bottom Part").GetComponent<BottleShelf>();
|
|
_tubeUI = transform.Find("Tube Part").GetComponent<TubeController>();
|
|
}
|
|
|
|
#region 对外开放
|
|
|
|
public IEnumerator OpenCoolingSystem()
|
|
{
|
|
yield return _pumpUI.Show();
|
|
}
|
|
|
|
public IEnumerator LinkTube()
|
|
{
|
|
// 播放插线动画,完成后自动关闭
|
|
// 立绘变化待补充
|
|
yield return _tubeUI.PlayLinkAnime();
|
|
}
|
|
|
|
public IEnumerator OpenBottleUI()
|
|
{
|
|
yield return _bottomUI.Show();
|
|
}
|
|
|
|
public void Unlock()
|
|
{
|
|
isLocked = false;
|
|
if (curBottle)
|
|
{
|
|
curBottle.IsBlock = false;
|
|
}
|
|
_pumpUI.OpenBuckle();
|
|
}
|
|
|
|
public void InsertBottle(CoolingBottle bottle)
|
|
{
|
|
// 设置为当前Bottle
|
|
curBottle = bottle;
|
|
}
|
|
|
|
public void Lock()
|
|
{
|
|
isLocked = true;
|
|
// 已锁定的瓶子禁止使用
|
|
if (curBottle)
|
|
{
|
|
curBottle.IsBlock = true;
|
|
}
|
|
_pumpUI.CloseBuckle();
|
|
}
|
|
|
|
public void StartPump()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void CloseBottleUI()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void CloseCoolingSystem()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void PullOutTube()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
public interface ICoolingSystem
|
|
{
|
|
// 打开冷却系统UI
|
|
public IEnumerator OpenCoolingSystem();
|
|
// 插管
|
|
public IEnumerator LinkTube();
|
|
// 打开左侧冷却液界面
|
|
public IEnumerator OpenBottleUI();
|
|
// 打开卡扣
|
|
public void Unlock();
|
|
// 插入冷却液瓶子
|
|
public void InsertBottle(CoolingBottle bottle);
|
|
// 关闭卡扣
|
|
public void Lock();
|
|
// 点击泵机开关
|
|
public void StartPump();
|
|
// 冷却液架收回
|
|
public void CloseBottleUI();
|
|
// 冷却系统UI收回
|
|
public void CloseCoolingSystem();
|
|
// 拔管
|
|
public void PullOutTube();
|
|
}
|
|
} |