首次提交
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user