问题齿轮
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
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.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();
|
||||
}
|
||||
|
||||
// 打开引擎盖子
|
||||
yield return gearSystem.OpenCover();
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
_configKey = arg.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user