修复浮漂和线
This commit is contained in:
@@ -19,7 +19,7 @@ namespace NBF
|
||||
[SerializeField] private Rigidbody preRigidbody;
|
||||
|
||||
private Rigidbody _rb;
|
||||
private SpringJoint _joint;
|
||||
private ConfigurableJoint _joint;
|
||||
private FLine _parentCable;
|
||||
|
||||
private float _lenght;
|
||||
@@ -27,7 +27,7 @@ namespace NBF
|
||||
public Rigidbody PreRigidbody => preRigidbody;
|
||||
public Rigidbody Rigidbody => _rb;
|
||||
public FLine ParentCable => _parentCable;
|
||||
public SpringJoint Joint => _joint;
|
||||
public ConfigurableJoint Joint => _joint;
|
||||
|
||||
public float Lenght => _lenght;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace NBF
|
||||
{
|
||||
_rb = GetComponent<Rigidbody>();
|
||||
_parentCable = GetComponentInParent<FLine>();
|
||||
_joint = GetComponent<SpringJoint>();
|
||||
_joint = GetComponent<ConfigurableJoint>();
|
||||
}
|
||||
|
||||
public void SetLenght(float lenght)
|
||||
@@ -45,7 +45,7 @@ namespace NBF
|
||||
_lenght = lenght;
|
||||
if (_joint)
|
||||
{
|
||||
_joint.maxDistance = lenght;
|
||||
_joint.linearLimit = new SoftJointLimit() { limit = lenght };
|
||||
}
|
||||
|
||||
if (rope)
|
||||
|
||||
@@ -93,15 +93,15 @@ namespace NBF
|
||||
}
|
||||
|
||||
|
||||
// public void OnUseItem(PlayerItemView item)
|
||||
// {
|
||||
// var itemType = item.Item.ConfigID.GetItemType();
|
||||
// if (itemType == ItemType.Rod)
|
||||
// {
|
||||
// _isRodLayerEnabled = true;
|
||||
// // _IK.SetBipedLeftHandIK(enabled: false, reel.FingersIKAnchor);
|
||||
// }
|
||||
// }
|
||||
public void OnUseItem(int configId)
|
||||
{
|
||||
var itemType = configId.GetItemType();
|
||||
if (itemType == ItemType.Rod)
|
||||
{
|
||||
_isRodLayerEnabled = true;
|
||||
// _IK.SetBipedLeftHandIK(enabled: false, reel.FingersIKAnchor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetLayerWeight(string layer, float weight)
|
||||
@@ -153,14 +153,13 @@ namespace NBF
|
||||
public void OnRodThrowStart()
|
||||
{
|
||||
Debug.LogError("OnRodThrowStart");
|
||||
// if (Player.State == PlayerState.Throw)
|
||||
// {
|
||||
// var playerStateView = Player.GetComponent<PlayerStateView>();
|
||||
// if (playerStateView.CurrentStateView is PlayerStageViewThrow playerStateThrow)
|
||||
// {
|
||||
// playerStateThrow.OnRodThrowStart();
|
||||
// }
|
||||
// }
|
||||
if (Player.State == PlayerState.Throw)
|
||||
{
|
||||
if (Player.CurrentStateView is PlayerStageViewThrow playerStateThrow)
|
||||
{
|
||||
playerStateThrow.OnRodThrowStart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -169,14 +168,13 @@ namespace NBF
|
||||
public void OnRodThrownEnd()
|
||||
{
|
||||
Debug.LogError("OnRodThrownEnd");
|
||||
// if (Player.State == PlayerState.Throw)
|
||||
// {
|
||||
// var playerStateView = Player.GetComponent<PlayerStateView>();
|
||||
// if (playerStateView.CurrentStateView is PlayerStageViewThrow playerStateThrow)
|
||||
// {
|
||||
// playerStateThrow.OnRodThrownEnd();
|
||||
// }
|
||||
// }
|
||||
if (Player.State == PlayerState.Throw)
|
||||
{
|
||||
if (Player.CurrentStateView is PlayerStageViewThrow playerStateThrow)
|
||||
{
|
||||
playerStateThrow.OnRodThrownEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace NBF
|
||||
new Dictionary<PlayerState, PlayerStageViewBase>();
|
||||
|
||||
private PlayerStageViewBase _currentStateView;
|
||||
|
||||
public PlayerStageViewBase CurrentStateView => _currentStateView;
|
||||
|
||||
private void InitState()
|
||||
{
|
||||
|
||||
@@ -87,38 +87,18 @@ namespace NBF
|
||||
}
|
||||
|
||||
var itemConfig = Game.Tables.TbItem.Get(configId);
|
||||
var Rod = itemConfig.InstantiateAndComponent<FRod>(Map.Instance.GearsNode, Vector3.zero,
|
||||
var rod = itemConfig.InstantiateAndComponent<FRod>(Map.Instance.GearsNode, Vector3.zero,
|
||||
Quaternion.identity);
|
||||
await Rod.Init(this, configId, bindItems);
|
||||
HandItem = Rod;
|
||||
await rod.Init(this, configId, bindItems);
|
||||
HandItem = rod;
|
||||
|
||||
// ModelAsset.PlayerAnimator.OnUseItem(itemView);
|
||||
|
||||
// if (currItem == null)
|
||||
// {
|
||||
// //收起物品
|
||||
// await UnUseItem(prevItem);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // 先收起旧的物品
|
||||
// await UnUseItemConfirm(prevItem);
|
||||
// var handItem = Player.HandItem;
|
||||
// //拿起新物品
|
||||
// var itemType = handItem.ConfigID.GetItemType();
|
||||
// if (itemType == ItemType.Rod)
|
||||
// {
|
||||
// var itemView = handItem.GetOrAddComponent<PlayerItemView>();
|
||||
// await itemView.InitShow(handItem);
|
||||
// Unity.ModelAsset.PlayerAnimator.OnUseItem(itemView);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// var stateView = Player.GetComponent<PlayerStateView>();
|
||||
// if (stateView != null && stateView.CurrentStateView is PlayerStageViewIdle playerStageViewIdle)
|
||||
// {
|
||||
// playerStageViewIdle.TakeLine();
|
||||
// }
|
||||
ModelAsset.PlayerAnimator.OnUseItem(configId);
|
||||
|
||||
|
||||
if (_currentStateView is PlayerStageViewIdle playerStageViewIdle)
|
||||
{
|
||||
playerStageViewIdle.TakeLine();
|
||||
}
|
||||
|
||||
IsChangeItemIng = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user