This commit is contained in:
2025-08-05 14:36:28 +08:00
parent bc3108867b
commit 18d95f855e
12 changed files with 140 additions and 22 deletions
@@ -124,6 +124,11 @@ MonoBehaviour:
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 8af5caad7811cc54d8cda81c2bee9154
m_Address: Assets/Language/Dialog/Fiction_Huoshan/Ficiton_Huoshan1 Shared Data.asset
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -143,6 +143,12 @@ MonoBehaviour:
m_SerializedLabels:
- Locale-zh-Hans
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 4478458ba31f7f648bf665c376a4c91b
m_Address: Ficiton_Huoshan1_zh-Hans
m_ReadOnly: 1
m_SerializedLabels:
- Locale-zh-Hans
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -143,6 +143,12 @@ MonoBehaviour:
m_SerializedLabels:
- Locale-en
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 3e2552a19e8eb384e8b5eb43a37c66b7
m_Address: Ficiton_Huoshan1_en
m_ReadOnly: 1
m_SerializedLabels:
- Locale-en
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
+12 -9
View File
@@ -477,15 +477,18 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
_filter:
- 0.007228916
- 0.043749984
- 0.12409639
- 0.20444278
- 0.24096388
- 0.20444278
- 0.12409639
- 0.043749984
- 0.007228916
- 0.004854369
- 0.021177985
- 0.06010355
- 0.106563106
- 0.14548868
- 0.1618123
- 0.1618123
- 0.14548868
- 0.106563106
- 0.06010355
- 0.021177985
- 0.004854369
--- !u!114 &-6101378415725230565
MonoBehaviour:
m_ObjectHideFlags: 3
+1 -1
View File
@@ -165,7 +165,7 @@ Material:
- _DirectionalAlphaFadeNoiseFactor: 0.2
- _DirectionalAlphaFadeRotation: 0
- _DirectionalAlphaFadeWidth: 0.2
- _DirectionalDistortionFade: 0
- _DirectionalDistortionFade: -15
- _DirectionalDistortionInvert: 1
- _DirectionalDistortionNoiseFactor: 0.2
- _DirectionalDistortionRandomDirection: 0.1
+2 -2
View File
@@ -10451,9 +10451,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: feee73ba51d6e1a4da81ed7f94ab4694, type: 3}
m_Name:
m_EditorClassIdentifier:
runMode: 0
runMode: 1
firstTalkSo: {fileID: 11400000, guid: 2f763a2c04ecafb4981379b7363f9791, type: 2}
testTalkSo: {fileID: 11400000, guid: 9e3b2c77ad4a9454188d458da2cf0ddd, type: 2}
testTalkSo: {fileID: 11400000, guid: fe71f935f1f9a52458c994362567a211, type: 2}
saveFileName:
--- !u!1 &719273460
GameObject:
@@ -6,15 +6,17 @@ namespace AibisDream.FixSystem
[CreateAssetMenu(fileName = "PipelineData", menuName = "Level Data/PipelineData")]
public class PipelineData : ScriptableObject
{
public PipelineObject[] pipelineObject;
public PipelineObjectData[] pipelineObjectDatas;
public float speed;
public float duration;
}
[Serializable]
public struct PipelineObject
public struct PipelineObjectData
{
public string name;
public Sprite sprite;
public Color color;
public int weight;
}
}
@@ -1,20 +1,40 @@
using AibisDream.Kit;
using System.Collections;
using AibisDream.Framework;
using AibisDream.Kit;
using AibisDream.Utility;
using UnityEngine;
namespace AibisDream.FixSystem
{
public class PipelineHandler
{
private PipelineData _data;
// private SimpleObjectPool<>
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>();
}
public void Start()
private void ResetObject(PipelineObject pipelineObject)
{
pipelineObject.transform.localPosition = Vector3.zero;
}
}
}
@@ -0,0 +1,70 @@
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;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 154b71b0aff44e378113c53b05dee71c
timeCreated: 1754294297
@@ -23,7 +23,7 @@ namespace AibisDream.Framework
public static Camera UICamera => UIManager.Instance.UICamera;
private CinemachineBrain _orthoCameraBrain;
private CinemachineBrain _perspectiveCameraBrain;
// private CinemachineBrain _perspectiveCameraBrain;
private readonly Dictionary<CameraEnum, ICinemachineCamera> _virtualCameraDict = new();
private readonly Dictionary<CameraEnum, CamState> _camInitStateDict = new();
@@ -54,7 +54,7 @@ namespace AibisDream.Framework
// 获取透视相机
_perspectiveMainCamera = GameObject.Find("PerspectiveMainCamera")?.GetComponent<Camera>();
_perspectiveCameraBrain = _perspectiveMainCamera?.GetComponent<CinemachineBrain>();
// _perspectiveCameraBrain = _perspectiveMainCamera?.GetComponent<CinemachineBrain>();
_curCameraEnum = CameraEnum.Default;
@@ -174,8 +174,9 @@ namespace AibisDream.Framework
// 切换主相机
bool isPerspective = _camInitStateDict[camType].isPerspective;
_orthoMainCamera.gameObject.SetActive(!isPerspective);
_perspectiveMainCamera.gameObject.SetActive(isPerspective);
var activeBrain = isPerspective ? _perspectiveCameraBrain : _orthoCameraBrain;
// _perspectiveMainCamera.gameObject.SetActive(isPerspective);
// var activeBrain = isPerspective ? _perspectiveCameraBrain : _orthoCameraBrain;
var activeBrain = _orthoCameraBrain;
// 设置虚拟相机优先级
foreach (var camPair in _virtualCameraDict)
+2
View File
@@ -42,6 +42,8 @@ namespace AibisDream.Utility
public const string BubblePrefab = "NormalBubble";
public const string PipelinePrefabAddress = "PipelinePrefab";
#endregion
#region