152 lines
6.7 KiB
C#
152 lines
6.7 KiB
C#
using System;
|
|
using System.Collections;
|
|
using AibisDream.Framework;
|
|
using AibisDream.UI;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
public struct UfCue : IFixSceneCue
|
|
{
|
|
public FixSceneMode Mode => FixSceneMode.UF;
|
|
|
|
public IEnumerator Enter(FixTransition transition)
|
|
{
|
|
var ufSystem = FixSystemCenter.SystemDic.Get<UFSystem>();
|
|
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
|
// 先切BodyModule
|
|
if (!CameraKit.Instance.EqualToCameraState(CameraEnum.BodyModule))
|
|
{
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
|
}
|
|
|
|
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.UF);
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(0.5f);
|
|
ufSystem.OpenUFView();
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.EyeDeep);
|
|
eyeSystem.OnEnter();
|
|
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Eye);
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(0.5f);
|
|
}
|
|
|
|
public IEnumerator Exit(FixTransition transition)
|
|
{
|
|
float duration = 0.5f;
|
|
var ufSystem = FixSystemCenter.SystemDic.Get<UFSystem>();
|
|
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(duration);
|
|
eyeSystem.OnExit();
|
|
ufSystem.CloseUFView();
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.UF);
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(duration);
|
|
}
|
|
}
|
|
|
|
public struct EyeCue : IFixSceneCue
|
|
{
|
|
public FixSceneMode Mode => FixSceneMode.Eye;
|
|
|
|
public IEnumerator Enter(FixTransition transition)
|
|
{
|
|
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
|
bodyModuleSystem.SwitchModuleGroup(ModuleState.Head);
|
|
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
|
// 先切BodyModule
|
|
if (!CameraKit.Instance.EqualToCameraState(CameraEnum.BodyModule))
|
|
{
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
|
}
|
|
|
|
//打开盖子
|
|
var eyeModule = bodyModuleSystem.FindBodyModuleByType<EyeModule>();
|
|
yield return eyeModule.OpenEye();
|
|
|
|
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);
|
|
eyeSystem.OnEnter();
|
|
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Eye);
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(0.5f);
|
|
}
|
|
|
|
public IEnumerator EnterImmediate(FixTransition transition)
|
|
{
|
|
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.EyeDeep, true);
|
|
eyeSystem.OnEnter();
|
|
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Eye);
|
|
}
|
|
|
|
public IEnumerator Exit(FixTransition transition)
|
|
{
|
|
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
|
float duration = 0.5f;
|
|
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(duration);
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Eye);
|
|
eyeSystem.OnExit();
|
|
yield return new WaitForSeconds(0.1f);
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(duration);
|
|
//关上
|
|
var eyeModule = bodyModuleSystem.FindBodyModuleByType<EyeModule>();
|
|
yield return eyeModule.CloseEye();
|
|
yield return new WaitForSeconds(0.5f);
|
|
}
|
|
}
|
|
|
|
public struct MemoryCue : IFixSceneCue
|
|
{
|
|
public FixSceneMode Mode => FixSceneMode.Memory;
|
|
|
|
public IEnumerator Enter(FixTransition transition)
|
|
{
|
|
float duration = 0.5f;
|
|
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
|
// 进入Memory前收起Task面板
|
|
FixPanelSystem.Instance.TaskPanel?.SetTemporarilyHidden(true);
|
|
// 先切BodyModule
|
|
if (!CameraKit.Instance.EqualToCameraState(CameraEnum.BodyModule))
|
|
{
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
|
}
|
|
|
|
yield return memorySystem.DropMemoryProjector();
|
|
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Memory);
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(duration);
|
|
memorySystem.OnEnter();
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(duration);
|
|
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Memory);
|
|
}
|
|
|
|
public IEnumerator EnterImmediate(FixTransition transition)
|
|
{
|
|
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
|
|
|
FixPanelSystem.Instance.TaskPanel?.SetTemporarilyHidden(true, immediate: true);
|
|
yield return memorySystem.DropMemoryProjector();
|
|
FixPanelSystem.GetRepairPanel<CablePanel>()?.PullUpCable();
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Memory, true);
|
|
memorySystem.OnEnter();
|
|
BubbleSlotKit.Instance.LoadBubbles(BubbleSlotEnum.Memory);
|
|
}
|
|
|
|
public IEnumerator Exit(FixTransition transition)
|
|
{
|
|
float duration = 0.5f;
|
|
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeInAsync(duration);
|
|
memorySystem.OnExit();
|
|
memorySystem.CloseMemoryView();
|
|
yield return UIManager.Instance.GetPanel<ScreenTransitionPanel>().FadeOutAsync(duration);
|
|
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
|
memorySystem.PullMemoryProjector();
|
|
// 退出Memory后恢复Task面板
|
|
FixPanelSystem.Instance.TaskPanel?.SetTemporarilyHidden(false);
|
|
}
|
|
}
|
|
}
|