86 lines
2.6 KiB
C#
86 lines
2.6 KiB
C#
using System.Collections;
|
|
using AibisDream.Framework;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
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.Load();
|
|
}
|
|
}
|
|
|
|
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);
|
|
// 相机归位
|
|
CameraKit.Instance.ResetCamara();
|
|
// 打开诊所
|
|
clinicSystem.gameObject.SetActive(true);
|
|
// 黑屏淡出
|
|
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
|
}
|
|
|
|
public void SetArgs(string arg)
|
|
{
|
|
// 没有参数
|
|
}
|
|
}
|
|
} |