Merge branch 'feature/stone-day2' into feature/merge
This commit is contained in:
@@ -91,6 +91,10 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
coolingBottle.Rotate(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeSlot(CoolingBottle coolingBottle)
|
||||
{
|
||||
InsertSlotEvent?.Invoke(coolingBottle);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace AibisDream.FixSystem
|
||||
public void StartMove()
|
||||
{
|
||||
_rb.isKinematic = false;
|
||||
gameObject.layer = LayerMask.NameToLayer("Clinic");
|
||||
// 开始移动时就切换成横版
|
||||
Rotate(false);
|
||||
}
|
||||
@@ -92,13 +93,15 @@ namespace AibisDream.FixSystem
|
||||
// 更新到新的Slot
|
||||
curSnapSlot = targetSlot;
|
||||
|
||||
curSnapSlot.InsertSlot(this);
|
||||
curSnapSlot.ChangeSlot(this);
|
||||
}
|
||||
|
||||
targetSnapSlotSet.Clear();
|
||||
|
||||
// 吸附到目标位置
|
||||
_rb.isKinematic = true;
|
||||
gameObject.layer = LayerMask.NameToLayer("Default");
|
||||
curSnapSlot.InsertSlot(this);
|
||||
transform.DOMove(curSnapSlot.transform.position, SnapMoveTime);
|
||||
|
||||
// TODO 停止描边
|
||||
|
||||
@@ -68,14 +68,14 @@ namespace AibisDream.Framework
|
||||
public void InsertBottle(CoolingBottle bottle)
|
||||
{
|
||||
// 设置当前瓶子名称
|
||||
DialogController.Instance.SetVariable("$curBottleName", bottle.data.name);
|
||||
// 触发插入对话
|
||||
DialogController.Instance.StartDialogNode("插入冷却液");
|
||||
// DialogController.Instance.SetVariable("$curBottleName", bottle.data.name);
|
||||
// // 触发插入对话
|
||||
// DialogController.Instance.StartDialogNode("插入冷却液");
|
||||
}
|
||||
|
||||
public void RemoveBottle()
|
||||
{
|
||||
DialogController.Instance.SetVariable("$curBottleName", "");
|
||||
// DialogController.Instance.SetVariable("$curBottleName", "");
|
||||
}
|
||||
|
||||
public void Lock()
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public class BodyModuleTransition
|
||||
{
|
||||
public struct BodyModuleToGearCommand : 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 gearSystem = FixSystemCenter.SystemDic.Get<GearSystem>();
|
||||
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
yield return CameraKit.Instance.TransCamera(CameraPos, OrthographicSize, Duration).WaitForCompletion();
|
||||
|
||||
// 打开引擎盖子
|
||||
yield return gearSystem.OpenCover();
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
// 暂无参数
|
||||
}
|
||||
}
|
||||
|
||||
public struct GearToBodyModuleCommand : ITransitionCommand
|
||||
{
|
||||
public IEnumerator Execute()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void SetArgs(string arg)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae4ece844a9a417687bd443b4cdf7820
|
||||
timeCreated: 1735242780
|
||||
@@ -49,8 +49,8 @@ namespace AibisDream.Framework
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.K))
|
||||
{
|
||||
MonoCenter.Mono.StartCoroutine(FixSystemYarnCommand.SwitchFixSystemTo("Eye"));
|
||||
|
||||
MonoCenter.Mono.StartCoroutine(FixSystemCenter.SystemDic.Get<CoolingSystem>().OpenCoolingSystem());
|
||||
MonoCenter.Mono.StartCoroutine(FixSystemCenter.SystemDic.Get<CoolingSystem>().OpenBottleUI());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using AibisDream.FixSystem;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
using Framework.Core;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream
|
||||
@@ -15,7 +16,9 @@ namespace AibisDream
|
||||
[SerializeField] private GameObject gearPrefab;
|
||||
[SerializeField] private GameObject shaftPrefab;
|
||||
private Shaft[] _shafts;
|
||||
|
||||
private SpriteRenderer _cover;
|
||||
private Transform _coverStick;
|
||||
|
||||
#endregion
|
||||
|
||||
private ShaftGraph _shaftGraph;
|
||||
@@ -30,13 +33,18 @@ namespace AibisDream
|
||||
public void Init()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
this.FindComponents();
|
||||
_shafts = GetComponentsInChildren<Shaft>();
|
||||
|
||||
_cover = transform.Find("Cover").GetComponent<SpriteRenderer>();
|
||||
_coverStick = transform.Find("Cover Stick");
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_shaftGraph = new ShaftGraph(_shafts);
|
||||
if (_shafts != null && _shafts.Length != 0)
|
||||
{
|
||||
_shaftGraph = new ShaftGraph(_shafts);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -69,7 +77,6 @@ namespace AibisDream
|
||||
/// <param name="pos">位置</param>
|
||||
/// <param name="radius">半径</param>
|
||||
/// <param name="sprite">齿轮图片</param>
|
||||
/// <param name="speed">速度</param>
|
||||
/// <returns>齿轮Obj</returns>
|
||||
public GameObject InitGear(Vector3 pos, float radius, Sprite sprite)
|
||||
{
|
||||
@@ -95,6 +102,28 @@ namespace AibisDream
|
||||
Debug.Log("达成目标");
|
||||
}
|
||||
|
||||
public IEnumerator OpenCover()
|
||||
{
|
||||
// 滑杆旋转
|
||||
yield return _coverStick.DORotate(new Vector3(0, 0, -90f), 1f).WaitForCompletion();
|
||||
// 盖子移动
|
||||
var sq = DOTween.Sequence();
|
||||
sq.Join(_cover.transform.DOLocalMove(new Vector3(-1.86f, 2.11f, 0), 1f));
|
||||
sq.Join(_cover.DOFade(0, 1f));
|
||||
yield return sq.WaitForCompletion();
|
||||
}
|
||||
|
||||
public IEnumerator CloseCover()
|
||||
{
|
||||
// 盖子移动
|
||||
var sq = DOTween.Sequence();
|
||||
sq.Join(_cover.transform.DOLocalMove(new Vector3(-1.86f, -0.38f, 0), 1f));
|
||||
sq.Join(_cover.DOFade(0, 1f));
|
||||
yield return sq.WaitForCompletion();
|
||||
// 滑杆旋转
|
||||
yield return _coverStick.DORotate(new Vector3(0, 0, 0), 1f).WaitForCompletion();
|
||||
}
|
||||
|
||||
#region 数据保存与加载
|
||||
|
||||
public static string DataPath = Application.streamingAssetsPath + "/LevelData/GearSystem/";
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 999ff60e53f68cc42b783630507e7781
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,41 +0,0 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace AibisDream.Test
|
||||
{
|
||||
public class OptionTest : MonoBehaviour
|
||||
{
|
||||
private GameObject panel;
|
||||
private GameObject prefab;
|
||||
private GameObject[] buttonGroup;
|
||||
private YarnOption[] _options;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// 初始化时注册Command
|
||||
// 第一个参数为[command name=xxx]的参数
|
||||
// 第二个参数是注册的函数,在Yarn走到选择项时触发
|
||||
DialogController.Instance.RegisterPauseCommand("show_buttons", ShowButtons);
|
||||
|
||||
// 不重要
|
||||
panel = transform.GetChild(0).gameObject;
|
||||
prefab = Resources.Load<GameObject>("Prefabs/UI/Choice Button");
|
||||
}
|
||||
|
||||
public void ShowButtons(YarnContinueStep step)
|
||||
{
|
||||
var option = step;
|
||||
var instance = Instantiate(prefab, panel.transform, true);
|
||||
var textMesh = instance.GetComponentInChildren<TextMeshProUGUI>();
|
||||
textMesh.text = "继续对话";
|
||||
|
||||
instance.GetComponent<Button>().onClick.AddListener(() => {
|
||||
// 执行SelectOption(), 对话就会从对应的选项往下继续执行
|
||||
option.ContinueTalk();
|
||||
instance.SetActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5897053db6d09014c809a2f20396e2ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user