ECM2
This commit is contained in:
@@ -3,14 +3,14 @@ using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class PlayArm : MonoBehaviour
|
||||
public class PlayerArm : MonoBehaviour
|
||||
{
|
||||
public bool IsLeft;
|
||||
public LimbIK IK;
|
||||
public Transform RodContainer;
|
||||
public Transform LeftRigMagnet;
|
||||
public FingerRig FingerRig;
|
||||
|
||||
public PlayerShoulder Shoulder;//PlayerShoulder
|
||||
|
||||
[HideInInspector] public float interactionTargetWeight;
|
||||
|
||||
|
||||
37
Assets/Scripts/Fishing/New/PlayerShoulder.cs
Normal file
37
Assets/Scripts/Fishing/New/PlayerShoulder.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class PlayerShoulder : MonoBehaviour
|
||||
{
|
||||
private Vector3 startEulerAngles;
|
||||
private const int MaxAngle = 30;
|
||||
private const int MinAngle = -30;
|
||||
|
||||
|
||||
public float TestZ;
|
||||
private void Awake()
|
||||
{
|
||||
startEulerAngles = transform.localEulerAngles;
|
||||
}
|
||||
|
||||
public void SetCameraEulerAngleX(float value)
|
||||
{
|
||||
value = (value > 180f) ? value - 360f : value;
|
||||
Debug.Log($"value={value}");
|
||||
var addValue = value * -1;
|
||||
if (addValue > MaxAngle)
|
||||
{
|
||||
addValue = MaxAngle;
|
||||
}
|
||||
else if (addValue < MinAngle)
|
||||
{
|
||||
addValue = MinAngle;
|
||||
}
|
||||
|
||||
transform.localEulerAngles =
|
||||
new Vector3(addValue + startEulerAngles.x, startEulerAngles.y, TestZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing/New/PlayerShoulder.cs.meta
Normal file
3
Assets/Scripts/Fishing/New/PlayerShoulder.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d621debd7244988afb98b7c06605f63
|
||||
timeCreated: 1747228668
|
||||
@@ -31,10 +31,10 @@ public partial class FPlayer : MonoBehaviour
|
||||
|
||||
public Fsm<FPlayer> Fsm { get; private set; }
|
||||
|
||||
private PlayArm[] Arms;
|
||||
public PlayArm MainArm { get; private set; }
|
||||
private PlayerArm[] Arms;
|
||||
public PlayerArm MainArm { get; private set; }
|
||||
|
||||
public PlayArm MinorArm { get; private set; }
|
||||
public PlayerArm MinorArm { get; private set; }
|
||||
|
||||
public PlayerAnimator PlayerAnimatorCtrl;
|
||||
|
||||
@@ -62,7 +62,7 @@ public partial class FPlayer : MonoBehaviour
|
||||
LureTrajectorySimulator = gameObject.AddComponent<LureTrajectorySimulator>();
|
||||
|
||||
PlayerAnimatorCtrl.Player = this;
|
||||
Arms = GetComponentsInChildren<PlayArm>();
|
||||
Arms = GetComponentsInChildren<PlayerArm>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
||||
@@ -103,10 +103,10 @@ namespace NBF
|
||||
if (_owner.Gears.Rod)
|
||||
{
|
||||
//如果准备好了杆子,则可进入抛竿
|
||||
if (_nextState)
|
||||
{
|
||||
return States.Player.WaitThrow;
|
||||
}
|
||||
// if (_nextState)
|
||||
// {
|
||||
// return States.Player.WaitThrow;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,5 +117,13 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (_player.MainArm)
|
||||
{
|
||||
// _player.MainArm.Shoulder.SetCameraEulerAngleX(BaseCamera.Main.transform.localEulerAngles.x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class SceneSettings : MonoBehaviour
|
||||
private void Start()
|
||||
{
|
||||
// EnviroManager.instance.Time.Settings.simulate = true;
|
||||
EnviroManager.instance.Time.SetTimeOfDay(0.1f * 24f);
|
||||
EnviroManager.instance.Time.SetTimeOfDay(0.5f * 24f);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
Reference in New Issue
Block a user