Merge branch 'bugfix/shone' into 'develop'
小问题修改 See merge request aibis-dream/aibis-dream!147
This commit is contained in:
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -332,6 +332,10 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: Body Module System
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4070921155132268514, guid: 92aec29b557d59a4ca5363aadd06c7bb, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8209014069305634267, guid: 92aec29b557d59a4ca5363aadd06c7bb, type: 3}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
@@ -1472,7 +1476,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curLevel: 1
|
||||
heightY: 0.783
|
||||
heightY: 0.562
|
||||
minY: 0.221
|
||||
--- !u!61 &551825979
|
||||
BoxCollider2D:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
@@ -71,9 +72,15 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
heatMapController=transform.Find("HeatMapController").GetComponent<HeatMapController>();
|
||||
}
|
||||
Debug.Log("Register");
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 寻找最接近的Module
|
||||
/// </summary>
|
||||
|
||||
@@ -5,6 +5,62 @@ 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);
|
||||
// 黑屏淡出
|
||||
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.CloseCoverAsync();
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance?.FadeInSync(FadeDuration);
|
||||
// 相机归位
|
||||
CameraKit.Instance.ResetCamara();
|
||||
// 打开诊所
|
||||
clinicSystem.gameObject.SetActive(true);
|
||||
// 关闭其他
|
||||
ITransitionCommand.SetBodyModuleSystemActive(false);
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance?.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 无需参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct GearToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
private const float Duration = 2f;
|
||||
@@ -74,6 +130,8 @@ namespace AibisDream.FixSystem
|
||||
CameraKit.Instance.ResetCamara();
|
||||
// 打开诊所
|
||||
clinicSystem.gameObject.SetActive(true);
|
||||
// 关闭其他
|
||||
ITransitionCommand.SetBodyModuleSystemActive(false);
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,13 @@ namespace AibisDream.FixSystem
|
||||
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
|
||||
bodyModuleSystem.CurDataKey = _configName;
|
||||
bodyModuleSystem.Load();
|
||||
@@ -47,18 +51,17 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var engineSystem = FixSystemCenter.SystemDic.Get<EngineSystem>();
|
||||
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance.FadeInSync(FadeDuration);
|
||||
yield return MainUIController.Instance?.FadeInSync(FadeDuration);
|
||||
// 激活
|
||||
ITransitionCommand.SetBodyModuleSystemActive(true);
|
||||
// 隐藏诊所
|
||||
clinicSystem.gameObject.SetActive(false);
|
||||
// 激活插线系统
|
||||
bodyModuleSystem.gameObject.SetActive(true);
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
yield return MainUIController.Instance?.FadeOutSync(FadeDuration);
|
||||
// 移动相机
|
||||
yield return CameraKit.Instance.TransCameraAsync(CameraPos, OrthographicSize, Duration);
|
||||
// 开启引擎玩法
|
||||
@@ -120,8 +123,6 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public struct ClinicToGearCommand : ITransitionCommand
|
||||
{
|
||||
private const float FadeDuration = 0.5f;
|
||||
|
||||
// 引擎相机设置
|
||||
private static readonly Vector3 CameraPos = new(-1.09f, -0.07f, -10);
|
||||
private const float OrthographicSize = 1.6f;
|
||||
@@ -131,14 +132,12 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
|
||||
// 激活
|
||||
ITransitionCommand.SetBodyModuleSystemActive(true);
|
||||
// 隐藏诊所
|
||||
clinicSystem.gameObject.SetActive(false);
|
||||
// 激活插线系统
|
||||
bodyModuleSystem.gameObject.SetActive(true);
|
||||
// 移动相机
|
||||
yield return CameraKit.Instance.TransCameraAsync(CameraPos, OrthographicSize, Duration);
|
||||
// 开启引擎玩法
|
||||
|
||||
@@ -20,35 +20,21 @@ namespace AibisDream.FixSystem
|
||||
|
||||
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 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);
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 暂无参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct BodyModuleToEngineCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
@@ -113,33 +99,6 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
}
|
||||
|
||||
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.CloseCoverAsync();
|
||||
// 黑屏
|
||||
yield return MainUIController.Instance.FadeInSync(FadeDuration);
|
||||
// 相机归位
|
||||
CameraKit.Instance.ResetCamara();
|
||||
// 打开诊所
|
||||
clinicSystem.gameObject.SetActive(true);
|
||||
// 黑屏淡出
|
||||
yield return MainUIController.Instance.FadeOutSync(FadeDuration);
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 无需参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct BodyModuleToEyeCommand : ITransitionCommand
|
||||
{
|
||||
// 引擎相机设置
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace AibisDream.Framework
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.K))
|
||||
{
|
||||
MonoCenter.Mono.StartCoroutine(FixSystemYarnCommand.SwitchFixSystemTo("Gear"));
|
||||
MonoCenter.Mono.StartCoroutine(FixSystemYarnCommand.SwitchFixSystemTo("Engine"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ namespace AibisDream
|
||||
{
|
||||
float levelHeight = heightY / (_engineSystem.config.maxLevel - 1);
|
||||
var curY = levelHeight * curLevel + minY;
|
||||
transform.position = new Vector3(transform.position.x, curY, transform.position.z);
|
||||
transform.localPosition = new Vector3(transform.localPosition.x, curY, transform.localPosition.z);
|
||||
}
|
||||
|
||||
private void SwitchAirLevel(float mouseY)
|
||||
{
|
||||
mouseY -= minY;
|
||||
mouseY -= minY + transform.parent.position.y;
|
||||
|
||||
float levelHeight = heightY / _engineSystem.config.maxLevel;
|
||||
curLevel = (int)(mouseY / levelHeight);
|
||||
@@ -47,6 +47,12 @@ namespace AibisDream
|
||||
if (curLevel < 0) curLevel = 0;
|
||||
}
|
||||
|
||||
public void MoveToLevel(int level)
|
||||
{
|
||||
curLevel = level - 1;
|
||||
UpdateTransform();
|
||||
}
|
||||
|
||||
public void StopMove()
|
||||
{
|
||||
_engineSystem.UpdateAirLevel(curLevel);
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace AibisDream
|
||||
public static string DataPath = Application.streamingAssetsPath + "/LevelData/EngineSystem/";
|
||||
|
||||
private SpriteRenderer _cover;
|
||||
private AirGate _airGate;
|
||||
|
||||
[Header("系统配置")] [SerializeField] public EngineConfig config;
|
||||
[Header("系统数据")] [SerializeField] private EngineData engineData;
|
||||
@@ -33,12 +34,20 @@ namespace AibisDream
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
_cover = transform.Find("Cover").GetComponent<SpriteRenderer>();
|
||||
_airGate = transform.Find("Air Gate").GetComponent<AirGate>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
engineData = new EngineData(config.invalidTime);
|
||||
|
||||
// 初始档位置为2
|
||||
_airGate.MoveToLevel(2);
|
||||
DialogController.Instance?.SetVariable("$curAirLevel", 2);
|
||||
engineData.UpdateAirLevel(1, config.maxLevel); // 内部档位从0计数,1就是2
|
||||
|
||||
gameObject.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -82,8 +91,8 @@ namespace AibisDream
|
||||
public void UpdateAirLevel(int curLevel)
|
||||
{
|
||||
engineData.UpdateAirLevel(curLevel, config.maxLevel);
|
||||
DialogController.Instance.SetVariable("$curAirLevel", curLevel + 1);
|
||||
DialogController.Instance.StartDialogNode("调整进气档位");
|
||||
DialogController.Instance?.SetVariable("$curAirLevel", curLevel + 1);
|
||||
DialogController.Instance?.StartDialogNode("调整进气档位");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -62,6 +62,8 @@ namespace AibisDream
|
||||
_shaftGraph = new ShaftGraph(shafts, panelShafts);
|
||||
|
||||
_panel.gameObject.SetActive(false);
|
||||
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user