diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset index 17754227d..d2611808c 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-Assets-Shared.asset @@ -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: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Chinese (Simplified) (zh-Hans).asset b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Chinese (Simplified) (zh-Hans).asset index 6bd664c14..9ea81c92e 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Chinese (Simplified) (zh-Hans).asset +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-Chinese (Simplified) (zh-Hans).asset @@ -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: diff --git a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset index 0189fcff9..ac6ad2826 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset +++ b/Assets/AddressableAssetsData/AssetGroups/Localization-String-Tables-English (en).asset @@ -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: diff --git a/Assets/Render/Renderer2Dtest.asset b/Assets/Render/Renderer2Dtest.asset index 1eab44ea8..4ed517d20 100644 --- a/Assets/Render/Renderer2Dtest.asset +++ b/Assets/Render/Renderer2Dtest.asset @@ -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 diff --git a/Assets/Resources/Materials/MemoryForFade.mat b/Assets/Resources/Materials/MemoryForFade.mat index 9e7b05c7e..0659b3043 100644 --- a/Assets/Resources/Materials/MemoryForFade.mat +++ b/Assets/Resources/Materials/MemoryForFade.mat @@ -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 diff --git a/Assets/Scenes/Persistence.unity b/Assets/Scenes/Persistence.unity index 75d9763c6..da25dea8a 100644 --- a/Assets/Scenes/Persistence.unity +++ b/Assets/Scenes/Persistence.unity @@ -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: diff --git a/Assets/Scripts/FixSystemNew/WhackMole/PipelineData.cs b/Assets/Scripts/FixSystemNew/WhackMole/PipelineData.cs index c31fad49f..9ca2f7fbd 100644 --- a/Assets/Scripts/FixSystemNew/WhackMole/PipelineData.cs +++ b/Assets/Scripts/FixSystemNew/WhackMole/PipelineData.cs @@ -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; } } \ No newline at end of file diff --git a/Assets/Scripts/FixSystemNew/WhackMole/PipelineHandler.cs b/Assets/Scripts/FixSystemNew/WhackMole/PipelineHandler.cs index 0e101c602..3696d6e70 100644 --- a/Assets/Scripts/FixSystemNew/WhackMole/PipelineHandler.cs +++ b/Assets/Scripts/FixSystemNew/WhackMole/PipelineHandler.cs @@ -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 _pool; + private readonly ISelector _selector; public PipelineHandler(PipelineData data) { _data = data; + _pipelinePrefab = ResourceKit.LoadAssetSync(ConstRef.PipelinePrefabAddress); + // 对象池 + _pool = new SimpleObjectPool(InstantiateObject, ResetObject); + // 随机选择器 + _selector = new SingleSelector(_data.pipelineObjectDatas, item => item.weight); + } + + private PipelineObject InstantiateObject() + { + var obj = Object.Instantiate(_pipelinePrefab, _pipelineRoot); + return obj.GetComponent(); } - public void Start() + private void ResetObject(PipelineObject pipelineObject) { - + pipelineObject.transform.localPosition = Vector3.zero; } + + } } \ No newline at end of file diff --git a/Assets/Scripts/FixSystemNew/WhackMole/PipelineObject.cs b/Assets/Scripts/FixSystemNew/WhackMole/PipelineObject.cs new file mode 100644 index 000000000..423d380dd --- /dev/null +++ b/Assets/Scripts/FixSystemNew/WhackMole/PipelineObject.cs @@ -0,0 +1,70 @@ +using System; +using UnityEngine; + +namespace AibisDream.FixSystem +{ + public class PipelineObject : MonoBehaviour + { + #region 组件 + + private SpriteRenderer _renderer; + + public event Action 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(); + _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; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/FixSystemNew/WhackMole/PipelineObject.cs.meta b/Assets/Scripts/FixSystemNew/WhackMole/PipelineObject.cs.meta new file mode 100644 index 000000000..e5f0ee424 --- /dev/null +++ b/Assets/Scripts/FixSystemNew/WhackMole/PipelineObject.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 154b71b0aff44e378113c53b05dee71c +timeCreated: 1754294297 \ No newline at end of file diff --git a/Assets/Scripts/Framework/OtherKit/CameraKit.cs b/Assets/Scripts/Framework/OtherKit/CameraKit.cs index 463f9b430..2089c0e6e 100644 --- a/Assets/Scripts/Framework/OtherKit/CameraKit.cs +++ b/Assets/Scripts/Framework/OtherKit/CameraKit.cs @@ -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 _virtualCameraDict = new(); private readonly Dictionary _camInitStateDict = new(); @@ -54,7 +54,7 @@ namespace AibisDream.Framework // 获取透视相机 _perspectiveMainCamera = GameObject.Find("PerspectiveMainCamera")?.GetComponent(); - _perspectiveCameraBrain = _perspectiveMainCamera?.GetComponent(); + // _perspectiveCameraBrain = _perspectiveMainCamera?.GetComponent(); _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) diff --git a/Assets/Scripts/Utility/ConstRef.cs b/Assets/Scripts/Utility/ConstRef.cs index dd68c6665..d22a4fe6e 100644 --- a/Assets/Scripts/Utility/ConstRef.cs +++ b/Assets/Scripts/Utility/ConstRef.cs @@ -42,6 +42,8 @@ namespace AibisDream.Utility public const string BubblePrefab = "NormalBubble"; + public const string PipelinePrefabAddress = "PipelinePrefab"; + #endregion #region 动画配置