上下视角控制
This commit is contained in:
@@ -40,6 +40,7 @@ namespace NBF
|
||||
FirstPerson = gameObject.GetComponent<FirstPersonCharacter>();
|
||||
Data = FPlayerData.Instance;
|
||||
transform.localPosition = new Vector3(484, 1, 422);
|
||||
// Data.NeedChangeRightArmAngle = true;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@@ -53,6 +54,8 @@ namespace NBF
|
||||
{
|
||||
UpdateMove();
|
||||
Fsm?.Update();
|
||||
|
||||
Data.EyeAngle = GameUtils.GetVerticalAngle(transform, FppLook);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace NBF
|
||||
public enum PlayerState : uint
|
||||
{
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 闲置等待中
|
||||
/// </summary>
|
||||
@@ -74,6 +75,11 @@ namespace NBF
|
||||
|
||||
public Vector2 MoveInput;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public float EyeAngle;
|
||||
|
||||
|
||||
public PlayerState PreviousState => _previousPlayerState;
|
||||
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
using RootMotion.FinalIK;
|
||||
using System;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class PlayerArm : MonoBehaviour
|
||||
{
|
||||
public bool FixLowerArm;
|
||||
public bool IsLeft;
|
||||
public LimbIK IK;
|
||||
public Transform LowerArm;
|
||||
public Transform RodContainer;
|
||||
public FingerRig FingerRig;
|
||||
|
||||
|
||||
|
||||
[HideInInspector] public float interactionTargetWeight;
|
||||
|
||||
private const int MaxFixEyeAngle = 15;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Assets/Scripts/Fishing/Player/PlayerChest.cs
Normal file
25
Assets/Scripts/Fishing/Player/PlayerChest.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class PlayerChest : MonoBehaviour
|
||||
{
|
||||
private const int MaxFixEyeAngle = 15;
|
||||
private const int MinFixEyeAngle = -10;
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
FixArmAngle();
|
||||
}
|
||||
|
||||
private void FixArmAngle()
|
||||
{
|
||||
var angle = FPlayerData.Instance.EyeAngle;
|
||||
|
||||
if (angle > MaxFixEyeAngle) angle = MaxFixEyeAngle;
|
||||
else if (angle < MinFixEyeAngle) angle = MinFixEyeAngle;
|
||||
var val = transform.localEulerAngles;
|
||||
transform.localEulerAngles = new Vector3(val.x, val.y, val.z - angle);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing/Player/PlayerChest.cs.meta
Normal file
3
Assets/Scripts/Fishing/Player/PlayerChest.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e152a74e74b54d17ace5403a1570e12a
|
||||
timeCreated: 1768668096
|
||||
Reference in New Issue
Block a user