齿轮控制
This commit is contained in:
@@ -83,7 +83,7 @@ MonoBehaviour:
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: da47117d0e2720c4a8dc0bac3acb3cac
|
||||
m_Address: Assets/Language/Dialog/Test_OP/Test_OP Shared Data.asset
|
||||
m_Address: Assets/Language/Dialog/Test/Test Shared Data.asset
|
||||
m_ReadOnly: 1
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ MonoBehaviour:
|
||||
- Locale-zh-Hans
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 533b33b4a1f64604c99fc25138b1a50a
|
||||
m_Address: Test_OP_zh-Hans
|
||||
m_Address: Test_zh-Hans
|
||||
m_ReadOnly: 1
|
||||
m_SerializedLabels:
|
||||
- Locale-zh-Hans
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ MonoBehaviour:
|
||||
- Locale-en
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 58ce8964b8b71fd43989e4688bb56792
|
||||
m_Address: Test_OP_en
|
||||
m_Address: Test_en
|
||||
m_ReadOnly: 1
|
||||
m_SerializedLabels:
|
||||
- Locale-en
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -15,53 +15,53 @@ MonoBehaviour:
|
||||
m_TableCollectionName: Test
|
||||
m_TableCollectionNameGuidString: da47117d0e2720c4a8dc0bac3acb3cac
|
||||
m_Entries:
|
||||
- m_Id: 25394824256425984
|
||||
m_Key: line:0559767
|
||||
m_Metadata:
|
||||
m_Items:
|
||||
- rid: 2067218753147109378
|
||||
- m_Id: 26134354672488448
|
||||
- m_Id: 111840071680
|
||||
m_Key: line:02365db
|
||||
m_Metadata:
|
||||
m_Items:
|
||||
- rid: 2067218753147109379
|
||||
- m_Id: 26134354676682752
|
||||
- rid: 5935570708321796308
|
||||
- m_Id: 111869431808
|
||||
m_Key: line:0559767
|
||||
m_Metadata:
|
||||
m_Items:
|
||||
- rid: 5935570708321796309
|
||||
- m_Id: 111869431809
|
||||
m_Key: line:0ee9c21
|
||||
m_Metadata:
|
||||
m_Items:
|
||||
- rid: 2067218753147109380
|
||||
- m_Id: 26134354676682753
|
||||
- rid: 5935570708321796310
|
||||
- m_Id: 111869431810
|
||||
m_Key: line:003a5c5
|
||||
m_Metadata:
|
||||
m_Items:
|
||||
- rid: 2067218753147109381
|
||||
- rid: 5935570708321796311
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
m_KeyGenerator:
|
||||
rid: 128120912349757446
|
||||
rid: 5935570708321796307
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 128120912349757446
|
||||
- rid: 5935570708321796307
|
||||
type: {class: DistributedUIDGenerator, ns: UnityEngine.Localization.Tables, asm: Unity.Localization}
|
||||
data:
|
||||
m_CustomEpoch: 1747199431587
|
||||
- rid: 2067218753147109378
|
||||
m_CustomEpoch: 1754395704238
|
||||
- rid: 5935570708321796308
|
||||
type: {class: LineMetadata, ns: Yarn.Unity.UnityLocalization, asm: YarnSpinner.Unity}
|
||||
data:
|
||||
nodeName: Start
|
||||
tags: []
|
||||
- rid: 2067218753147109379
|
||||
- rid: 5935570708321796309
|
||||
type: {class: LineMetadata, ns: Yarn.Unity.UnityLocalization, asm: YarnSpinner.Unity}
|
||||
data:
|
||||
nodeName: Start
|
||||
tags: []
|
||||
- rid: 2067218753147109380
|
||||
- rid: 5935570708321796310
|
||||
type: {class: LineMetadata, ns: Yarn.Unity.UnityLocalization, asm: YarnSpinner.Unity}
|
||||
data:
|
||||
nodeName: "\u6253\u5730\u9F20\u6E38\u620F\u901A\u8FC7"
|
||||
tags: []
|
||||
- rid: 2067218753147109381
|
||||
- rid: 5935570708321796311
|
||||
type: {class: LineMetadata, ns: Yarn.Unity.UnityLocalization, asm: YarnSpinner.Unity}
|
||||
data:
|
||||
nodeName: "\u6253\u5730\u9F20\u6E38\u620F\u5931\u8D25"
|
||||
|
||||
@@ -18,19 +18,19 @@ MonoBehaviour:
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
m_TableData:
|
||||
- m_Id: 25394824256425984
|
||||
m_Localized: "me: \u6253\u5730\u9F20\u6D4B\u8BD5"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 26134354672488448
|
||||
- m_Id: 111840071680
|
||||
m_Localized: "me: \u6D4B\u8BD5[[size]]\u53D8\u5927[[/size]]\u6B63\u5E38"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 26134354676682752
|
||||
- m_Id: 111869431808
|
||||
m_Localized: "me: \u6253\u5730\u9F20\u6D4B\u8BD5"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 111869431809
|
||||
m_Localized: "me: \u6210\u529F"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
- m_Id: 26134354676682753
|
||||
- m_Id: 111869431810
|
||||
m_Localized: "me: \u5931\u8D25"
|
||||
m_Metadata:
|
||||
m_Items: []
|
||||
|
||||
@@ -477,18 +477,19 @@ MonoBehaviour:
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
_filter:
|
||||
- 0.004854369
|
||||
- 0.021177985
|
||||
- 0.06010355
|
||||
- 0.106563106
|
||||
- 0.14548868
|
||||
- 0.1618123
|
||||
- 0.1618123
|
||||
- 0.14548868
|
||||
- 0.106563106
|
||||
- 0.06010355
|
||||
- 0.021177985
|
||||
- 0.004854369
|
||||
- 0.0048309183
|
||||
- 0.016401261
|
||||
- 0.04532712
|
||||
- 0.08293076
|
||||
- 0.12053438
|
||||
- 0.14946026
|
||||
- 0.1610306
|
||||
- 0.14946026
|
||||
- 0.12053438
|
||||
- 0.08293076
|
||||
- 0.04532712
|
||||
- 0.016401261
|
||||
- 0.0048309183
|
||||
--- !u!114 &-6101378415725230565
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
[CreateAssetMenu(fileName = "PipelineData", menuName = "Level Data/PipelineData")]
|
||||
public class PipelineData : ScriptableObject
|
||||
{
|
||||
public PipelineObjectData[] pipelineObjectDatas;
|
||||
public float speed;
|
||||
public float duration;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct PipelineObjectData
|
||||
{
|
||||
public string name;
|
||||
public Sprite sprite;
|
||||
public Color color;
|
||||
public int weight;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a90fdee3f4a04219bd08a9ca37d10a14
|
||||
timeCreated: 1754037172
|
||||
@@ -1,40 +0,0 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
using AibisDream.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public class PipelineHandler
|
||||
{
|
||||
private PipelineData _data;
|
||||
private readonly GameObject _pipelinePrefab;
|
||||
private Transform _pipelineRoot;
|
||||
private SimpleObjectPool<PipelineObject> _pool;
|
||||
private readonly ISelector<PipelineObjectData> _selector;
|
||||
|
||||
public PipelineHandler(PipelineData data)
|
||||
{
|
||||
_data = data;
|
||||
_pipelinePrefab = ResourceKit.LoadAssetSync<GameObject>(ConstRef.PipelinePrefabAddress);
|
||||
// 对象池
|
||||
_pool = new SimpleObjectPool<PipelineObject>(InstantiateObject, ResetObject);
|
||||
// 随机选择器
|
||||
_selector = new SingleSelector<PipelineObjectData>(_data.pipelineObjectDatas, item => item.weight);
|
||||
}
|
||||
|
||||
private PipelineObject InstantiateObject()
|
||||
{
|
||||
var obj = Object.Instantiate(_pipelinePrefab, _pipelineRoot);
|
||||
return obj.GetComponent<PipelineObject>();
|
||||
}
|
||||
|
||||
private void ResetObject(PipelineObject pipelineObject)
|
||||
{
|
||||
pipelineObject.transform.localPosition = Vector3.zero;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9ee39516ca547039795a9b0d0a3c11d
|
||||
timeCreated: 1754036892
|
||||
@@ -1,70 +0,0 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.FixSystem
|
||||
{
|
||||
public class PipelineObject : MonoBehaviour
|
||||
{
|
||||
#region 组件
|
||||
|
||||
private SpriteRenderer _renderer;
|
||||
|
||||
public event Action<PipelineObject, bool> OnObjEnd;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数据
|
||||
|
||||
private float _speed;
|
||||
private float _maxDistance;
|
||||
|
||||
private bool _isActive;
|
||||
private Vector3 _initPos;
|
||||
|
||||
#endregion
|
||||
|
||||
private void Init(PipelineObjectData data, float speed, float maxDistance)
|
||||
{
|
||||
_renderer = GetComponent<SpriteRenderer>();
|
||||
_renderer.sprite = data.sprite;
|
||||
_renderer.color = data.color;
|
||||
|
||||
_initPos = transform.position;
|
||||
_speed = speed;
|
||||
_maxDistance = maxDistance;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_isActive)
|
||||
{
|
||||
transform.position += _speed * Time.deltaTime * Vector3.right;
|
||||
if (IsReachedEnd())
|
||||
{
|
||||
OnPipelineEnd(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsReachedEnd()
|
||||
{
|
||||
return transform.position.x > _initPos.x + _maxDistance;
|
||||
}
|
||||
|
||||
private void OnPipelineEnd(bool isReachedEnd)
|
||||
{
|
||||
_isActive = false;
|
||||
gameObject.SetActive(false);
|
||||
OnObjEnd?.Invoke(this, isReachedEnd);
|
||||
}
|
||||
|
||||
public bool TryRecycle(Vector3 pos, float usefulDistance)
|
||||
{
|
||||
if (!_isActive) return false;
|
||||
if (Vector3.Distance(pos, transform.position) > usefulDistance) return false;
|
||||
|
||||
OnPipelineEnd(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 154b71b0aff44e378113c53b05dee71c
|
||||
timeCreated: 1754294297
|
||||
@@ -161,7 +161,7 @@ namespace AibisDream
|
||||
#region 交互锁定相关
|
||||
|
||||
public bool IsActive => !isConstant;
|
||||
public bool IsAvailable => _gearSystem.isAvailable;
|
||||
public bool IsAvailable => _gearSystem.IsGearActive;
|
||||
|
||||
public GameObject GetGameObject()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AibisDream.FixSystem;
|
||||
using AibisDream.Framework;
|
||||
@@ -39,6 +40,11 @@ namespace AibisDream
|
||||
private bool _isTargetReached;
|
||||
private bool _isDiscReady;
|
||||
public bool isAvailable;
|
||||
private bool _isInteractive;
|
||||
|
||||
public bool IsGearActive => isAvailable && _isInteractive;
|
||||
|
||||
private IUnRegister[] _evtUnRegisters;
|
||||
|
||||
public float initSpeed = 1;
|
||||
|
||||
@@ -62,6 +68,21 @@ namespace AibisDream
|
||||
CameraKit.Instance.RegisterCamera(CameraEnum.Gear, virtualCam);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
var unRegister1 = EnumEventSystem.Global.Register(InteractionEventEnum.Start, () => _isInteractive = true);
|
||||
var unRegister2 = EnumEventSystem.Global.Register(InteractionEventEnum.End, () => _isInteractive = false);
|
||||
_evtUnRegisters = new[] { unRegister1, unRegister2 };
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
foreach (var evtUnRegister in _evtUnRegisters)
|
||||
{
|
||||
evtUnRegister.UnRegister();
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
InitShaftGraph();
|
||||
@@ -149,6 +170,7 @@ namespace AibisDream
|
||||
{
|
||||
StorageSystem.Instance?.SetValue("$allNewGear", true);
|
||||
}
|
||||
|
||||
DialogController.Instance?.StartDialogNode("AllGearsRunning");
|
||||
}
|
||||
}
|
||||
@@ -352,14 +374,14 @@ namespace AibisDream
|
||||
Debug.Log("没有找到配置项");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 删除面板上的齿轮
|
||||
var panelShafts = transform.Find("Empty Shafts Panel").GetComponentsInChildren<Shaft>();
|
||||
foreach (var shaftItem in panelShafts)
|
||||
{
|
||||
Destroy(shaftItem);
|
||||
}
|
||||
|
||||
|
||||
// 读取数据
|
||||
var panelShaftRoot = transform.Find("Empty Shafts Panel");
|
||||
var newPanelShafts = new Shaft[data.panelShaftArray.Length];
|
||||
@@ -369,7 +391,7 @@ namespace AibisDream
|
||||
newShaft.Load(data.panelShaftArray[i]);
|
||||
newPanelShafts[i] = newShaft;
|
||||
}
|
||||
|
||||
|
||||
_shaftGraph.UpdatePanel(newPanelShafts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user