This commit is contained in:
2025-05-14 16:14:32 +08:00
parent 543b38d930
commit 9e4fef3f1e
16 changed files with 358 additions and 27 deletions

View File

@@ -310,6 +310,24 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Back",
"type": "Button",
"id": "6b649cc4-0104-4234-bfe9-2d647df3862d",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "ReUse",
"type": "Button",
"id": "45a833e1-2aaf-4907-ae1e-1d97ee260b18",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
@@ -873,6 +891,28 @@
"action": "Quick9",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "9f16f60c-4749-4672-bdaf-9fb804c0b6f1",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "",
"action": "Back",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "7e0ce3aa-9cf2-4b1e-9995-756ccbdeeda4",
"path": "<Keyboard>/y",
"interactions": "",
"processors": "",
"groups": "",
"action": "ReUse",
"isComposite": false,
"isPartOfComposite": false
}
]
},

View File

@@ -35,7 +35,6 @@ MonoBehaviour:
- ACTk.Runtime
- Assembly-CSharp
- Assembly-CSharp-firstpass
- ECM2
- Enviro3.Runtime
- FairyGUI
- NBC.Asset

View File

@@ -15,11 +15,12 @@ Material:
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
- _SPECULAR_SETUP
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
@@ -134,7 +135,7 @@ Material:
- _Translucency: 0.437
- _TranslucencySky: 0
- _UVSec: 0
- _WorkflowMode: 1
- _WorkflowMode: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}

View File

@@ -1805,6 +1805,127 @@ Transform:
m_Children: []
m_Father: {fileID: 775476582679568209}
m_LocalEulerAnglesHint: {x: 111.71363, y: 31.299614, z: 179.15817}
--- !u!1 &2233656924474144110
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7687587028653530281}
- component: {fileID: 7246126600745223226}
- component: {fileID: 7353203226863854876}
m_Layer: 9
m_Name: FishingLight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7687587028653530281
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2233656924474144110}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.042}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5273066534610348271}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!108 &7246126600745223226
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2233656924474144110}
m_Enabled: 1
serializedVersion: 11
m_Type: 0
m_Color: {r: 0.5764706, g: 0.5764706, b: 0.5764706, a: 1}
m_Intensity: 1.5
m_Range: 10
m_SpotAngle: 73
m_InnerSpotAngle: 67.310555
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!114 &7353203226863854876
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2233656924474144110}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0
--- !u!1 &2246287374850370723
GameObject:
m_ObjectHideFlags: 0
@@ -4375,6 +4496,7 @@ MonoBehaviour:
isHandOnHandle: 0
lineLength: 0
reelSpeed: 0
openLight: 0
state: 0
lineCutTimer: 0
selectorRodSetting: 0
@@ -4384,8 +4506,8 @@ MonoBehaviour:
handPullUp: 0
PlayerAnimatorCtrl: {fileID: 0}
Gears: {fileID: 0}
LineRenderer: {fileID: 0}
LureTrajectorySimulator: {fileID: 0}
Light: {fileID: 7687587028653530281}
--- !u!114 &8072573713298176091
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -6417,10 +6539,11 @@ Transform:
m_GameObject: {fileID: 8796494894830104914}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.000000049033613, y: 1.514, z: 0.16835652}
m_LocalPosition: {x: 0, y: 1.514, z: 0.169}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 7687587028653530281}
m_Father: {fileID: 7989316057193859911}
m_LocalEulerAnglesHint: {x: 0, y: -0, z: -0}
--- !u!1 &8802192845069397003

View File

@@ -12,6 +12,7 @@ Material:
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHATEST_ON
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
@@ -20,9 +21,9 @@ Material:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: Opaque
RenderType: TransparentCutout
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
@@ -88,8 +89,8 @@ Material:
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _AlphaClip: 1
- _AlphaToMask: 1
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1

View File

@@ -12,15 +12,15 @@ Material:
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _SPECGLOSSMAP
- _SPECULAR_SETUP
m_InvalidKeywords: []
m_LightmapFlags: 1
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
@@ -111,14 +111,14 @@ Material:
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0
- _Smoothness: 0.632
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _WorkflowMode: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}

17
Assets/Scripts/ArmTest.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using UnityEngine;
public class ArmTest : MonoBehaviour
{
public Vector3 target;
private void Start()
{
target = transform.localEulerAngles;
}
private void LateUpdate()
{
transform.localEulerAngles = target;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ad83af85ff21b474ca9354a150f14517

View File

@@ -0,0 +1,8 @@
namespace NBF
{
public class GameDef
{
public const int NormalFOV = 50;
public const int ZoomedFOV = 25;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e0e959f45daf44f2b7bf1efe6e8fbc2b
timeCreated: 1747147951

View File

@@ -26,6 +26,7 @@ namespace NBF
public float currentReelingSpeed;
public bool isHandOnHandle;
/// <summary>
/// 线长度
/// </summary>
@@ -36,6 +37,16 @@ namespace NBF
/// </summary>
public float reelSpeed;
/// <summary>
/// 打开手电筒
/// </summary>
public bool openLight;
/// <summary>
/// 打开望远镜
/// </summary>
public bool openTelescope;
/// <summary>
/// 当前状态
/// </summary>

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using DG.Tweening;
using NBC;
using NBF;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
@@ -40,10 +41,10 @@ public partial class FPlayer : MonoBehaviour
public FPlayerUseGear Gears;
public LineRenderer LineRenderer;
public LureTrajectorySimulator LureTrajectorySimulator;
public Transform Light;
private void Awake()
{
PlayerAnimatorCtrl = gameObject.GetComponent<PlayerAnimator>();
@@ -58,7 +59,6 @@ public partial class FPlayer : MonoBehaviour
Gears = gameObject.AddComponent<FPlayerUseGear>();
}
LineRenderer = gameObject.GetComponent<LineRenderer>();
LureTrajectorySimulator = gameObject.AddComponent<LureTrajectorySimulator>();
PlayerAnimatorCtrl.Player = this;
@@ -156,17 +156,44 @@ public partial class FPlayer : MonoBehaviour
Gears?.Update();
}
if (Input.GetKeyDown(KeyCode.F))
SyncLight();
}
private void SyncLight()
{
if (Light)
{
var points = LureTrajectorySimulator.Test(BaseCamera.Main.transform);
// FishingCastInput exampleInput = FishingCastInput.Default();
// points = LureTrajectorySimulator.CalculateTrajectory(exampleInput);
Light.localRotation = BaseCamera.Main.transform.localRotation;
if (Light.gameObject.activeSelf != Data.openLight)
{
Light.gameObject.SetActive(Data.openLight);
}
}
}
private Tween _fovTween; // 存储当前的Tween动画方便中断
private float _zoomDuration = 0.2f; // 缩放动画时间
/// <summary>
/// 切换望远镜效果(打开/关闭)
/// </summary>
/// <param name="isZoomIn">true=打开望远镜false=关闭望远镜</param>
public void ToggleTelescope()
{
// 如果已经有动画在运行,先停止
_fovTween?.Kill();
// 根据传入的参数决定目标FOV
float targetFOV = Data.openTelescope ? GameDef.ZoomedFOV : GameDef.NormalFOV;
// 使用DoTween平滑过渡FOV
_fovTween = DOTween.To(
() => BaseCamera.Main.fieldOfView, // 获取当前FOV
x => BaseCamera.Main.fieldOfView = x, // 设置新FOV
targetFOV, // 目标FOV
_zoomDuration // 动画时间
).SetEase(Ease.InOutQuad); // 使用缓动函数让动画更平滑
}
public bool CanChangeGear()
{

View File

@@ -36,11 +36,15 @@ namespace NBF
App.Inst.SetMouseCurrsor(false);
InputManager.OnQuickIndexAction += OnQuickIndexAction;
InputManager.OnUseTorchAction += OnUseTorchAction;
InputManager.OnUseTelescopeAction += OnUseTelescopeAction;
}
private void OnDestroy()
{
InputManager.OnQuickIndexAction -= OnQuickIndexAction;
InputManager.OnUseTorchAction -= OnUseTorchAction;
InputManager.OnUseTelescopeAction -= OnUseTelescopeAction;
}
private void EnableFirstPersonController()
@@ -53,6 +57,23 @@ namespace NBF
nextShowSlotIndex = index;
}
private void OnUseTorchAction(bool ret)
{
if (!ret)
{
_player.Data.openLight = !_player.Data.openLight;
}
}
private void OnUseTelescopeAction(bool ret)
{
if (!ret)
{
_player.Data.openTelescope = !_player.Data.openTelescope;
_player.ToggleTelescope();
}
}
private void Update()
{
var movementAxis = InputManager.GetMovementInput();

View File

@@ -398,6 +398,24 @@ namespace NBF
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Back"",
""type"": ""Button"",
""id"": ""6b649cc4-0104-4234-bfe9-2d647df3862d"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""ReUse"",
""type"": ""Button"",
""id"": ""45a833e1-2aaf-4907-ae1e-1d97ee260b18"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
@@ -961,6 +979,28 @@ namespace NBF
""action"": ""Quick9"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""9f16f60c-4749-4672-bdaf-9fb804c0b6f1"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Back"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""7e0ce3aa-9cf2-4b1e-9995-756ccbdeeda4"",
""path"": ""<Keyboard>/y"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""ReUse"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
@@ -1092,6 +1132,8 @@ namespace NBF
m_Normal_Quick7 = m_Normal.FindAction("Quick7", throwIfNotFound: true);
m_Normal_Quick8 = m_Normal.FindAction("Quick8", throwIfNotFound: true);
m_Normal_Quick9 = m_Normal.FindAction("Quick9", throwIfNotFound: true);
m_Normal_Back = m_Normal.FindAction("Back", throwIfNotFound: true);
m_Normal_ReUse = m_Normal.FindAction("ReUse", throwIfNotFound: true);
// UI
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
m_UI_Roll = m_UI.FindAction("Roll", throwIfNotFound: true);
@@ -1210,6 +1252,8 @@ namespace NBF
private readonly InputAction m_Normal_Quick7;
private readonly InputAction m_Normal_Quick8;
private readonly InputAction m_Normal_Quick9;
private readonly InputAction m_Normal_Back;
private readonly InputAction m_Normal_ReUse;
/// <summary>
/// Provides access to input actions defined in input action map "Normal".
/// </summary>
@@ -1358,6 +1402,14 @@ namespace NBF
/// </summary>
public InputAction @Quick9 => m_Wrapper.m_Normal_Quick9;
/// <summary>
/// Provides access to the underlying input action "Normal/Back".
/// </summary>
public InputAction @Back => m_Wrapper.m_Normal_Back;
/// <summary>
/// Provides access to the underlying input action "Normal/ReUse".
/// </summary>
public InputAction @ReUse => m_Wrapper.m_Normal_ReUse;
/// <summary>
/// Provides access to the underlying input action map instance.
/// </summary>
public InputActionMap Get() { return m_Wrapper.m_Normal; }
@@ -1485,6 +1537,12 @@ namespace NBF
@Quick9.started += instance.OnQuick9;
@Quick9.performed += instance.OnQuick9;
@Quick9.canceled += instance.OnQuick9;
@Back.started += instance.OnBack;
@Back.performed += instance.OnBack;
@Back.canceled += instance.OnBack;
@ReUse.started += instance.OnReUse;
@ReUse.performed += instance.OnReUse;
@ReUse.canceled += instance.OnReUse;
}
/// <summary>
@@ -1598,6 +1656,12 @@ namespace NBF
@Quick9.started -= instance.OnQuick9;
@Quick9.performed -= instance.OnQuick9;
@Quick9.canceled -= instance.OnQuick9;
@Back.started -= instance.OnBack;
@Back.performed -= instance.OnBack;
@Back.canceled -= instance.OnBack;
@ReUse.started -= instance.OnReUse;
@ReUse.performed -= instance.OnReUse;
@ReUse.canceled -= instance.OnReUse;
}
/// <summary>
@@ -2037,6 +2101,20 @@ namespace NBF
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnQuick9(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Back" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnBack(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "ReUse" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnReUse(InputAction.CallbackContext context);
}
/// <summary>
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "UI" which allows adding and removing callbacks.

View File

@@ -15,7 +15,7 @@ namespace NBF
private const long GameEpoch = 1672531200000; // 2023-01-01 00:00:00 UTC
// 时间加速比例 (1现实秒 = 15游戏秒)
private const int TimeAcceleration = 20;
private const int TimeAcceleration = 200;
//一天, 一小时, 一分钟固定时长(毫秒)
public const long DAY_MILLS = 86400000;

View File

@@ -43,7 +43,7 @@ public class SceneSettings : MonoBehaviour
private void Start()
{
// EnviroManager.instance.Time.Settings.simulate = true;
EnviroManager.instance.Time.SetTimeOfDay(0.4f * 24f);
EnviroManager.instance.Time.SetTimeOfDay(0.1f * 24f);
}
private void Update()