过时代码删除
This commit is contained in:
@@ -8,12 +8,12 @@ namespace AibisDream.FixSystem
|
||||
public void PlugOut();
|
||||
public Vector3 GetSocketPos();
|
||||
public bool IsAvailable(); // 新增方法
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class BaseSocket : MonoBehaviour, ISocket
|
||||
{
|
||||
private bool available = true;
|
||||
|
||||
public void PlugIn()
|
||||
{
|
||||
Debug.Log("Plug Back InitSocket");
|
||||
@@ -28,10 +28,10 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
return transform.position;
|
||||
}
|
||||
|
||||
public bool IsAvailable()
|
||||
{
|
||||
return available;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,54 +6,52 @@ using AibisDream;
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
public class ChipModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _ChipModule;
|
||||
private GameObject _chipModule;
|
||||
|
||||
private ChipData _ChipData;
|
||||
private ChipData _chipData;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// 将数据注册到数据容器内
|
||||
GameLoopManager.FixDataContainer.Register(_ChipData);
|
||||
GameLoopManager.FixDataContainer.Register(_chipData);
|
||||
// 添加加载逻辑
|
||||
_ChipData.LoadEvent += LoadData;
|
||||
_ChipModule = transform.Find("Chip").gameObject;
|
||||
_chipData.LoadEvent += LoadData;
|
||||
_chipModule = transform.Find("Chip").gameObject;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
|
||||
public void RemoveChipModule()
|
||||
{
|
||||
if (_ChipModule.activeInHierarchy)
|
||||
if (_chipModule.activeInHierarchy)
|
||||
{
|
||||
_ChipModule.SetActive(false);
|
||||
_chipModule.SetActive(false);
|
||||
}
|
||||
_ChipData.isChipRemoved=true;
|
||||
|
||||
|
||||
_chipData.isChipRemoved = true;
|
||||
}
|
||||
|
||||
public void InstallChipModule()
|
||||
{
|
||||
if (!_ChipModule.activeInHierarchy)
|
||||
if (!_chipModule.activeInHierarchy)
|
||||
{
|
||||
_ChipModule.SetActive(true);
|
||||
_chipModule.SetActive(true);
|
||||
}
|
||||
_ChipData.isChipRemoved=false;
|
||||
|
||||
_chipData.isChipRemoved = false;
|
||||
}
|
||||
|
||||
public void Chipinit()
|
||||
{
|
||||
_ChipModule.SetActive(!_ChipData.isChipRemoved);
|
||||
_chipModule.SetActive(!_chipData.isChipRemoved);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LoadData(ChipData ufData)
|
||||
{
|
||||
Chipinit(); // 读取存档文件时触发,将当前系统恢复为目标状态
|
||||
Chipinit(); // 读取存档文件时触发,将当前系统恢复为目标状态
|
||||
}
|
||||
|
||||
void Start()
|
||||
@@ -61,6 +59,7 @@ public class ChipModule : MonoBehaviour
|
||||
Chipinit();
|
||||
}
|
||||
}
|
||||
|
||||
public class ChipData : IData
|
||||
{
|
||||
public bool isChipRemoved = false;
|
||||
@@ -71,4 +70,4 @@ public class ChipData : IData
|
||||
{
|
||||
LoadEvent?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +1,75 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream;
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
public class UFModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _UFcover;
|
||||
private GameObject _UFModule;
|
||||
private GameObject _ufCover;
|
||||
private GameObject _ufModule;
|
||||
private UFData _ufData;
|
||||
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// 将数据注册到数据容器内
|
||||
GameLoopManager.FixDataContainer.Register(_ufData);
|
||||
// 添加加载逻辑
|
||||
_ufData.LoadEvent += LoadData;
|
||||
_UFModule = transform.Find("Module Pic").gameObject;
|
||||
_UFcover = transform.Find("Cover").gameObject;
|
||||
_ufModule = transform.Find("Module Pic").gameObject;
|
||||
_ufCover = transform.Find("Cover").gameObject;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
public void RemoveUFCover()
|
||||
{
|
||||
if (_UFcover.activeInHierarchy)
|
||||
if (_ufCover.activeInHierarchy)
|
||||
{
|
||||
_UFcover.SetActive(false);
|
||||
_ufCover.SetActive(false);
|
||||
}
|
||||
_ufData.isUFCoverRemoved=true;
|
||||
|
||||
_ufData.isUFCoverRemoved = true;
|
||||
}
|
||||
|
||||
public void RemoveUFModule()
|
||||
{
|
||||
if (_UFModule.activeInHierarchy)
|
||||
if (_ufModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(false);
|
||||
_ufModule.SetActive(false);
|
||||
}
|
||||
_ufData.isUFRemoved=true;
|
||||
|
||||
|
||||
_ufData.isUFRemoved = true;
|
||||
}
|
||||
|
||||
public void InstallUFCover()
|
||||
{
|
||||
if (!_UFcover.activeInHierarchy)
|
||||
if (!_ufCover.activeInHierarchy)
|
||||
{
|
||||
_UFcover.SetActive(true);
|
||||
_ufCover.SetActive(true);
|
||||
}
|
||||
_ufData.isUFCoverRemoved=false;
|
||||
|
||||
_ufData.isUFCoverRemoved = false;
|
||||
}
|
||||
|
||||
public void InstallUFModule()
|
||||
{
|
||||
if (!_UFModule.activeInHierarchy)
|
||||
if (!_ufModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(true);
|
||||
_ufModule.SetActive(true);
|
||||
}
|
||||
_ufData.isUFRemoved=false;
|
||||
|
||||
_ufData.isUFRemoved = false;
|
||||
}
|
||||
|
||||
public void UFinit()
|
||||
{
|
||||
_UFModule.SetActive(!_ufData.isUFRemoved);
|
||||
_UFcover.SetActive(!_ufData.isUFCoverRemoved);
|
||||
_ufModule.SetActive(!_ufData.isUFRemoved);
|
||||
_ufCover.SetActive(!_ufData.isUFCoverRemoved);
|
||||
}
|
||||
|
||||
|
||||
private void LoadData(UFData ufData)
|
||||
{
|
||||
UFinit(); // 读取存档文件时触发,将当前系统恢复为目标状态
|
||||
UFinit(); // 读取存档文件时触发,将当前系统恢复为目标状态
|
||||
}
|
||||
|
||||
void Start()
|
||||
@@ -79,9 +77,9 @@ public class UFModule : MonoBehaviour
|
||||
UFinit();
|
||||
}
|
||||
}
|
||||
|
||||
public class UFData : IData
|
||||
{
|
||||
|
||||
public bool isUFCoverRemoved = false;
|
||||
public bool isUFRemoved = false;
|
||||
|
||||
@@ -91,4 +89,4 @@ public class UFData : IData
|
||||
{
|
||||
LoadEvent?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
public class FixStateMachine
|
||||
{
|
||||
public FixState CurState => _curState.GetState;
|
||||
|
||||
private IState _curState;
|
||||
private string _curArgs;
|
||||
|
||||
@@ -48,6 +50,19 @@ namespace AibisDream.FixSystem
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public enum FixState
|
||||
{
|
||||
Default,
|
||||
Clinic,
|
||||
CoolingMachine,
|
||||
BodyModule,
|
||||
Memory,
|
||||
Eye,
|
||||
UF,
|
||||
Engine,
|
||||
Gear
|
||||
}
|
||||
|
||||
public interface IState
|
||||
{
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public class FixSystemCenter : Singleton<FixSystemCenter>
|
||||
{
|
||||
public FixState curState;
|
||||
public FixState CurState => StateMachine.CurState;
|
||||
|
||||
public override void OnSingletonInit()
|
||||
{
|
||||
SystemDic ??= new IOCContainer();
|
||||
InitTransitionDic();
|
||||
|
||||
// TODO 这个回头要改
|
||||
curState = FixState.Clinic;
|
||||
AudioManager.PlayAmb1Audio("amb_room");
|
||||
|
||||
// 初始化状态机
|
||||
@@ -41,50 +38,5 @@ namespace AibisDream.FixSystem
|
||||
public static FixStateMachine StateMachine;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 转场管理
|
||||
|
||||
private static readonly StateDictionary<ITransitionCommand> TransitionDic = new();
|
||||
|
||||
private void InitTransitionDic()
|
||||
{
|
||||
TransitionDic.Add(FixState.Clinic, FixState.BodyModule, new ClinicToBodyModuleCommand());
|
||||
TransitionDic.Add(FixState.BodyModule, FixState.Clinic, new BodyModuleToClinicCommand());
|
||||
TransitionDic.Add(FixState.BodyModule, FixState.Engine, new BodyModuleToEngineCommand());
|
||||
TransitionDic.Add(FixState.Engine, FixState.BodyModule, new EngineToBodyModuleCommand());
|
||||
TransitionDic.Add(FixState.Clinic, FixState.Engine, new ClinicToEngineCommand());
|
||||
TransitionDic.Add(FixState.Engine, FixState.Clinic, new EngineToClinicCommand());
|
||||
TransitionDic.Add(FixState.BodyModule, FixState.Eye, new BodyModuleToEyeCommand());
|
||||
TransitionDic.Add(FixState.Eye, FixState.BodyModule, new EyeToBodyModuleCommand());
|
||||
TransitionDic.Add(FixState.BodyModule, FixState.Memory, new BodyModuleToMemoryCommand());
|
||||
TransitionDic.Add(FixState.Memory, FixState.BodyModule, new MemoryToBodyModuleCommand());
|
||||
TransitionDic.Add(FixState.BodyModule, FixState.UF, new BodyModuleToUFCommand());
|
||||
TransitionDic.Add(FixState.UF, FixState.BodyModule, new UFToBodyModuleCommand());
|
||||
TransitionDic.Add(FixState.Clinic, FixState.CoolingMachine, new ClinicToCoolingCommand());
|
||||
TransitionDic.Add(FixState.CoolingMachine, FixState.Clinic, new CoolingToClinicCommand());
|
||||
TransitionDic.Add(FixState.BodyModule, FixState.Gear, new BodyModuleToGearCommand());
|
||||
TransitionDic.Add(FixState.Gear, FixState.BodyModule, new GearToBodyModuleCommand());
|
||||
TransitionDic.Add(FixState.Clinic, FixState.Gear, new ClinicToGearCommand());
|
||||
TransitionDic.Add(FixState.Gear, FixState.Clinic, new GearToClinicCommand());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 执行转场
|
||||
/// </summary>
|
||||
/// <param name="nextState">需要转换的状态</param>
|
||||
public ITransitionCommand TransToNextState(FixState nextState)
|
||||
{
|
||||
// 没存过的先打个日志报错
|
||||
if (!TransitionDic.TryGetValue(curState, nextState, out var command))
|
||||
{
|
||||
Debug.Log($"源为{curState.ToString()}, 目标为{nextState.ToString()}, 转场命令不存在");
|
||||
return null;
|
||||
}
|
||||
|
||||
curState = nextState;
|
||||
return command;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51102ff352f0a80499cae251e2267fe4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,147 +0,0 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public struct BodyModuleToClinicCommand : ITransitionCommand
|
||||
{
|
||||
private const float FadeDuration = 0.5f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance.FadeInSync(FadeDuration);
|
||||
// 把线插回去
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 诊所显示
|
||||
clinicSystem.gameObject.SetActive(true);
|
||||
// 关闭其他
|
||||
ITransitionCommand.SetBodyModuleSystemActive(false);
|
||||
AudioManager.PlayAmb1Audio("amb_room");
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 暂无参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct EngineToClinicCommand : ITransitionCommand
|
||||
{
|
||||
private const float FadeDuration = 0.5f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var engineSystem = FixSystemCenter.SystemDic.Get<EngineSystem>();
|
||||
|
||||
// 盖上盖子
|
||||
yield return engineSystem.CloseCover().WaitForCompletion();
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance?.FadeInSync(FadeDuration);
|
||||
// 相机归位
|
||||
yield return CameraKit.Instance.ReturnInitCameraAsync(FadeDuration);
|
||||
// 打开诊所
|
||||
clinicSystem.gameObject.SetActive(true);
|
||||
AudioManager.PlayAmb1Audio("amb_room");
|
||||
// 关闭其他
|
||||
ITransitionCommand.SetBodyModuleSystemActive(false);
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance?.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 无需参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct GearToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
|
||||
// 关盖子
|
||||
yield return gearSystem.CloseGearPanel();
|
||||
yield return gearSystem.CloseCover();
|
||||
// 相机返回
|
||||
yield return CameraKit.Instance.ReturnInitCamera(Duration).WaitForCompletion();
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 没有参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct BodyModuleToGearCommand : ITransitionCommand
|
||||
{
|
||||
private static readonly Vector3 CameraPos = new(-1.09f, -0.07f, -10);
|
||||
private const float OrthographicSize = 1.6f;
|
||||
private const float Duration = 2f;
|
||||
|
||||
private string _configKey;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
yield return CameraKit.Instance.TransCamera(CameraPos, OrthographicSize, Duration).WaitForCompletion();
|
||||
if (!string.IsNullOrEmpty(_configKey))
|
||||
{
|
||||
gearSystem.CurDataKey = _configKey;
|
||||
gearSystem.LoadLevel();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
_configKey = arg.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
public struct GearToClinicCommand : ITransitionCommand
|
||||
{
|
||||
private const float FadeDuration = 0.5f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
|
||||
// 盖上盖子
|
||||
yield return gearSystem.CloseGearPanel();
|
||||
yield return gearSystem.CloseCover();
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance.FadeInSync(FadeDuration);
|
||||
// 相机归位
|
||||
yield return CameraKit.Instance.ReturnInitCameraAsync(FadeDuration);
|
||||
// 打开诊所
|
||||
clinicSystem.gameObject.SetActive(true);
|
||||
// 关闭其他
|
||||
ITransitionCommand.SetBodyModuleSystemActive(false);
|
||||
AudioManager.PlayAmb1Audio("amb_room");
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 没有参数
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31019d1b228d41eeb89a89fa9d9dd7e4
|
||||
timeCreated: 1735296030
|
||||
@@ -1,168 +0,0 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public struct ClinicToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float FadeDuration = 1f;
|
||||
|
||||
private string _configName;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance.FadeInSync(FadeDuration);
|
||||
|
||||
// 激活
|
||||
ITransitionCommand.SetBodyModuleSystemActive(true);
|
||||
// 加载BodyModuleSystem
|
||||
if (!string.IsNullOrEmpty(_configName))
|
||||
{
|
||||
bodyModuleSystem.CurDataKey = _configName;
|
||||
bodyModuleSystem.LoadLevel();
|
||||
}
|
||||
|
||||
// 隐藏诊所
|
||||
clinicSystem.gameObject.SetActive(false);
|
||||
// 播下音频
|
||||
AudioManager.PlayAmb1Audio("amb_main");
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
_configName = arg;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ClinicToEngineCommand : ITransitionCommand
|
||||
{
|
||||
private const float FadeDuration = 0.5f;
|
||||
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(-2.5f, 2.13f, -10);
|
||||
private const float OrthographicSize = 2.5f;
|
||||
private const float Duration = 2f;
|
||||
|
||||
private string _configName;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var engineSystem = FixSystemCenter.SystemDic.Get<EngineSystem>();
|
||||
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance?.FadeInSync(FadeDuration);
|
||||
// 激活
|
||||
ITransitionCommand.SetBodyModuleSystemActive(true);
|
||||
// 隐藏诊所
|
||||
clinicSystem.gameObject.SetActive(false);
|
||||
AudioManager.PlayAmb1Audio("amb_main");
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance?.FadeOutSync(FadeDuration);
|
||||
// 移动相机
|
||||
yield return CameraKit.Instance.TransCameraAsync(CameraPos, OrthographicSize, Duration);
|
||||
// 开启引擎玩法
|
||||
if (!string.IsNullOrEmpty(_configName))
|
||||
{
|
||||
engineSystem.CurDataKey = _configName;
|
||||
engineSystem.LoadLevel();
|
||||
}
|
||||
|
||||
yield return engineSystem.OpenCover().WaitForCompletion();
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
_configName = arg;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ClinicToCoolingCommand : ITransitionCommand
|
||||
{
|
||||
private static readonly Vector3 CameraPos = new(6.61f, 0, -10);
|
||||
private const float Duration = 2f;
|
||||
private bool _playLink;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var coolingSystem = FixSystemCenter.SystemDic.Get<CoolingSystem>();
|
||||
// 移动相机
|
||||
yield return CameraKit.Instance.TransCameraAsync(CameraPos, Duration);
|
||||
// 打开泵机
|
||||
coolingSystem.gameObject.SetActive(true);
|
||||
yield return coolingSystem.OpenCoolingSystem();
|
||||
// 播放插线动画
|
||||
if (_playLink)
|
||||
{
|
||||
yield return coolingSystem.LinkTube();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
_playLink = !string.IsNullOrEmpty(arg);
|
||||
}
|
||||
}
|
||||
|
||||
public struct CoolingToClinicCommand : ITransitionCommand
|
||||
{
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var cooling = FixSystemCenter.SystemDic.Get<CoolingSystem>();
|
||||
|
||||
yield return cooling.CloseBottleUI();
|
||||
yield return cooling.CloseCoolingSystem();
|
||||
yield return new WaitForSeconds(1f);
|
||||
yield return CameraKit.Instance.ReturnInitCamera(2f);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 没有需要设置的
|
||||
}
|
||||
}
|
||||
|
||||
public struct ClinicToGearCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(-1.09f, -0.07f, -10);
|
||||
private const float OrthographicSize = 1.6f;
|
||||
private const float Duration = 2f;
|
||||
|
||||
private string _configName;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
// 激活
|
||||
ITransitionCommand.SetBodyModuleSystemActive(true);
|
||||
// 隐藏诊所
|
||||
clinicSystem.gameObject.SetActive(false);
|
||||
AudioManager.PlayAmb1Audio("amb_main");
|
||||
// 移动相机
|
||||
yield return CameraKit.Instance.TransCameraAsync(CameraPos, OrthographicSize, Duration);
|
||||
// 开启引擎玩法
|
||||
if (!string.IsNullOrEmpty(_configName))
|
||||
{
|
||||
gearSystem.CurDataKey = _configName;
|
||||
gearSystem.LoadLevel();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
_configName = arg.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df122109d96340d2a8525483632bf55d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,288 +0,0 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public enum FixState
|
||||
{
|
||||
Default,
|
||||
Clinic,
|
||||
CoolingMachine,
|
||||
BodyModule,
|
||||
Memory,
|
||||
Eye,
|
||||
UF,
|
||||
Engine,
|
||||
Gear
|
||||
}
|
||||
|
||||
public interface ITransitionCommand
|
||||
{
|
||||
protected static void SetBodyModuleSystemActive(bool active)
|
||||
{
|
||||
var gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var engineSystem = FixSystemCenter.SystemDic.Get<EngineSystem>();
|
||||
|
||||
gearSystem?.gameObject.SetActive(active);
|
||||
bodyModuleSystem?.gameObject.SetActive(active);
|
||||
engineSystem?.gameObject.SetActive(active);
|
||||
}
|
||||
|
||||
IEnumerator Execute();
|
||||
void SetArgs(string arg);
|
||||
}
|
||||
|
||||
public struct BodyModuleToEngineCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(-2.5f, 2.13f, -10);
|
||||
private const float OrthographicSize = 2.5f;
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var engineSystem = FixSystemCenter.SystemDic.Get<EngineSystem>();
|
||||
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
var cameraSq = CameraKit.Instance.TransCamera(CameraPos, OrthographicSize, Duration);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 打开引擎盖子
|
||||
var coverSq = engineSystem.OpenCover();
|
||||
while (coverSq.active && !coverSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct EngineToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var engineSystem = FixSystemCenter.SystemDic.Get<EngineSystem>();
|
||||
|
||||
// 关闭引擎盖
|
||||
var coverSq = engineSystem.CloseCover();
|
||||
while (coverSq.active && !coverSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 相机还原
|
||||
var cameraSq = CameraKit.Instance.ReturnInitCamera(Duration);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct BodyModuleToEyeCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(0f, 0.5f, -10);
|
||||
private const float OrthographicSize = 2f;
|
||||
private const float Duration = 1f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
||||
bodyModuleSystem.FindBodyModuleByName("Eye").transform.Find("Module Pic").GetComponent<SpriteRenderer>().sprite=Resources.Load<Sprite>("Art/Fix/Peipei/视觉盖子打开");
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
var cameraSq = CameraKit.Instance.TransCamera(CameraPos, OrthographicSize, Duration);
|
||||
yield return new WaitForSeconds(Duration/2);
|
||||
yield return MainUIController.Instance.FadeInSync(Duration/2);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
eyeSystem.OpenEyeView();
|
||||
eyeSystem.OnEnter();
|
||||
yield return MainUIController.Instance.FadeOutSync(Duration/2);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct EyeToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float Duration = 1f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
||||
//yield return new WaitForSeconds(Duration/2);
|
||||
yield return MainUIController.Instance.FadeInSync(Duration/2);
|
||||
eyeSystem.CloseEyeView();
|
||||
|
||||
// 相机还原
|
||||
var cameraSq = CameraKit.Instance.ReturnInitCamera(Duration);
|
||||
yield return new WaitForSeconds(Duration/2);
|
||||
yield return MainUIController.Instance.FadeOutSync(Duration/2);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
bodyModuleSystem.FindBodyModuleByName("Eye").transform.Find("Module Pic").GetComponent<SpriteRenderer>().sprite=Resources.Load<Sprite>("Art/Fix/Peipei/视觉盖子关闭");
|
||||
eyeSystem.OnExit();
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct BodyModuleToMemoryCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(-2.5f, 5f, -10);
|
||||
private const float OrthographicSize = 2.5f;
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
||||
yield return memorySystem.DropMemoryProjector();
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
var cameraSq = CameraKit.Instance.TransCamera(CameraPos, OrthographicSize, Duration);
|
||||
yield return new WaitForSeconds(Duration/2);
|
||||
yield return MainUIController.Instance.FadeInSync(Duration/2);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
memorySystem.OpenMemoryView();
|
||||
memorySystem.OnShow();
|
||||
yield return MainUIController.Instance.FadeOutSync(Duration/2);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct MemoryToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
||||
|
||||
yield return MainUIController.Instance.FadeInSync(Duration/2);
|
||||
memorySystem.OnExit();
|
||||
memorySystem.CloseMemoryView();
|
||||
// 相机还原
|
||||
var cameraSq = CameraKit.Instance.ReturnInitCamera(Duration);
|
||||
yield return new WaitForSeconds(Duration/2);
|
||||
|
||||
yield return MainUIController.Instance.FadeOutSync(Duration/2);
|
||||
yield return memorySystem.PullMemoryProjector();
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct BodyModuleToUFCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(-4.5f, 0.5f, -10);
|
||||
private const float OrthographicSize = 2.5f;
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var UFSystem = FixSystemCenter.SystemDic.Get<UFSystem>();
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
var cameraSq = CameraKit.Instance.TransCamera(CameraPos, OrthographicSize, Duration);
|
||||
yield return new WaitForSeconds(Duration/2);
|
||||
yield return MainUIController.Instance.FadeInSync(Duration/2);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
UFSystem.OpenUFView();
|
||||
yield return MainUIController.Instance.FadeOutSync(Duration/2);
|
||||
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct UFToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float Duration = 2f;
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var UFSystem = FixSystemCenter.SystemDic.Get<UFSystem>();
|
||||
|
||||
yield return MainUIController.Instance.FadeInSync(Duration/2);
|
||||
UFSystem.CloseUFView();
|
||||
|
||||
// 相机还原
|
||||
var cameraSq = CameraKit.Instance.ReturnInitCamera(Duration);
|
||||
yield return new WaitForSeconds(Duration/2);
|
||||
yield return MainUIController.Instance.FadeOutSync(Duration/2);
|
||||
while (cameraSq.active && !cameraSq.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 添加参数
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a69c67aba0d24b8994271ee886e11d3d
|
||||
timeCreated: 1733712418
|
||||
@@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// 以两个Key为索引的Dic
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Value类型</typeparam>
|
||||
public class StateDictionary<T>
|
||||
{
|
||||
private readonly Dictionary<StateTransKey, T> _stateDic = new();
|
||||
|
||||
public T Get(FixState source, FixState target)
|
||||
{
|
||||
var key = new StateTransKey(source, target);
|
||||
return _stateDic[key];
|
||||
}
|
||||
|
||||
public void Add(FixState source, FixState target, T value)
|
||||
{
|
||||
var key = new StateTransKey(source, target);
|
||||
_stateDic[key] = value;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_stateDic.Clear();
|
||||
}
|
||||
|
||||
public bool ContainsKey(FixState source, FixState target)
|
||||
{
|
||||
var key = new StateTransKey(source, target);
|
||||
return _stateDic.ContainsKey(key);
|
||||
}
|
||||
|
||||
public bool TryGetValue(FixState source, FixState target, out T value)
|
||||
{
|
||||
var key = new StateTransKey(source, target);
|
||||
return _stateDic.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用于实现两个Key的Dictionary
|
||||
/// </summary>
|
||||
private class StateTransKey
|
||||
{
|
||||
private readonly FixState _sourceState;
|
||||
private readonly FixState _targetState;
|
||||
|
||||
public StateTransKey(FixState sourceState, FixState targetState)
|
||||
{
|
||||
_sourceState = sourceState;
|
||||
_targetState = targetState;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// 类型不同肯定不相等
|
||||
if (obj is not StateTransKey other) return false;
|
||||
// 判断两个key相等
|
||||
return _sourceState == other._sourceState && _targetState == other._targetState;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(_sourceState, _targetState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ccd2ec5e9984317a57e8d005b0dc61a
|
||||
timeCreated: 1734236591
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b411a31369f4c779ca9d676e819b330
|
||||
timeCreated: 1736564645
|
||||
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
public class CursorManager : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a130c27daf3e4c118a7a9ce9ea4396e8
|
||||
timeCreated: 1736564679
|
||||
@@ -1,18 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UIScaler : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d0b48eff461151478535e39bfa03c82
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user