升级6.4.升级水,升级天气
This commit is contained in:
@@ -156,6 +156,8 @@ namespace NBF
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
//第一个节点到竿稍的位置-第一段鱼线长度
|
||||
return Vector3.Distance(Bobber.transform.position, Bobber.JointRb.transform.position) -
|
||||
fishingRope.GetCurrentLength();
|
||||
|
||||
@@ -311,37 +311,128 @@ namespace NBF
|
||||
|
||||
private List<float> previousWeights = Enumerable.Repeat(0f, 10).ToList();
|
||||
private float bendSmooth = 1f;
|
||||
public float maxRodStrength = 10f;
|
||||
public float CurrentTension01
|
||||
{
|
||||
get
|
||||
{
|
||||
float value = 0f;
|
||||
// if ((bool)currentReel && (bool)fishingLine)
|
||||
// {
|
||||
// float linePullingForce = currentReel.LinePullingForce;
|
||||
// value = Mathf.Min(fishingLine.CurrentLineTension, linePullingForce) / maxRodStrength;
|
||||
// }
|
||||
if (Line)
|
||||
{
|
||||
value = PlayerItem.Tension / maxRodStrength;
|
||||
}
|
||||
|
||||
return Mathf.Clamp01(value);
|
||||
}
|
||||
}
|
||||
|
||||
private void BendControl()
|
||||
{
|
||||
var _ccdik = Asset.CCDIK;
|
||||
|
||||
// Vector3 vector = (FishEntity.CurrentFishInFight
|
||||
// ? FishEntity.CurrentFishInFight.transform.position
|
||||
// : fishingLine.currentLineHandler.LineConnector_1.transform.position);
|
||||
|
||||
var ccdik = Asset.CCDIK;
|
||||
|
||||
var isThrowing = PlayerItem.Owner.State >= PlayerState.Fishing;
|
||||
|
||||
Vector3 vector = Line.Bobber.transform.position;
|
||||
// float num = Vector3.Distance(ccdik.solver.bones.Last().transform.position, vector);
|
||||
float num2 = 0.05f;
|
||||
|
||||
float num6 = 0.3f;
|
||||
//
|
||||
// float num = Vector3.Distance(_ccdik.solver.bones.Last().transform.position, vector);
|
||||
// float num2 = 0.05f;
|
||||
// if (currentFish)
|
||||
// {
|
||||
// float num3 = Vector3.Angle(base.transform.forward,
|
||||
// (currentFish.transform.position - transform.position).normalized) / 180f;
|
||||
// num2 = Mathf.Clamp(CurrentTension01 * num3, 0.05f, 1f);
|
||||
// }
|
||||
// else if (!isThrowing)
|
||||
// {
|
||||
// float num4 = 0.3f;
|
||||
// if (Lure)
|
||||
// {
|
||||
// num4 *= 0.6f;
|
||||
// }
|
||||
//
|
||||
// if (Bobber)
|
||||
// {
|
||||
// num4 *= 0.8f;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// float num5 = 1.5f;
|
||||
// if (num < num5)
|
||||
// {
|
||||
// num2 = Mathf.Lerp(num2, num4, 1f - num / num5);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// float num6 = 0.3f;
|
||||
// if (isThrowing)
|
||||
// {
|
||||
// num6 = 0.1f;
|
||||
// }
|
||||
// else if (!FishEntity.CurrentFishInFight)
|
||||
// else if (!currentFish)
|
||||
// {
|
||||
// num6 = 0.2f;
|
||||
// }
|
||||
|
||||
float target = num2 * num6;
|
||||
float item = Mathf.MoveTowards(ccdik.solver.IKPositionWeight, target, Time.deltaTime * bendSmooth);
|
||||
// float target = num2 * num6;
|
||||
|
||||
float target = 0;
|
||||
|
||||
float item = Mathf.MoveTowards(_ccdik.solver.IKPositionWeight, target, Time.deltaTime * bendSmooth);
|
||||
previousWeights.RemoveAt(0);
|
||||
previousWeights.Add(item);
|
||||
float num7 = previousWeights.Average();
|
||||
// if ((bool)FishEntity.CurrentFishInFight && FishEntity.CurrentFishInFight.IsCatched)
|
||||
if(currentFish)
|
||||
{
|
||||
num7 = Math.Min(num7, 0.01f);
|
||||
}
|
||||
|
||||
ccdik.solver.SetIKPosition(vector);
|
||||
ccdik.solver.SetIKPositionWeight(num7);
|
||||
_ccdik.solver.SetIKPosition(vector);
|
||||
_ccdik.solver.SetIKPositionWeight(num7);
|
||||
|
||||
// if (!currentFish)
|
||||
// {
|
||||
// //未中鱼
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // Vector3 vector = (FishEntity.CurrentFishInFight
|
||||
// // ? FishEntity.CurrentFishInFight.transform.position
|
||||
// // : fishingLine.currentLineHandler.LineConnector_1.transform.position);
|
||||
//
|
||||
// var ccdik = Asset.CCDIK;
|
||||
//
|
||||
// Vector3 vector = Line.Bobber.transform.position;
|
||||
// // float num = Vector3.Distance(ccdik.solver.bones.Last().transform.position, vector);
|
||||
// float num2 = 0.05f;
|
||||
//
|
||||
// float num6 = 0.3f;
|
||||
// // if (isThrowing)
|
||||
// // {
|
||||
// // num6 = 0.1f;
|
||||
// // }
|
||||
// // else if (!FishEntity.CurrentFishInFight)
|
||||
// // {
|
||||
// // num6 = 0.2f;
|
||||
// // }
|
||||
//
|
||||
// float target = num2 * num6;
|
||||
// float item = Mathf.MoveTowards(ccdik.solver.IKPositionWeight, target, Time.deltaTime * bendSmooth);
|
||||
// previousWeights.RemoveAt(0);
|
||||
// previousWeights.Add(item);
|
||||
// float num7 = previousWeights.Average();
|
||||
//
|
||||
// ccdik.solver.SetIKPosition(vector);
|
||||
// ccdik.solver.SetIKPositionWeight(num7);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user