poprawki materialy unity 6, pajaki, podmiana katalogu FSM w AIControlerze, zmiana w Spider 2.0 Behaviours , skopane zycie bylo, ladowalo pajaka z zyciem 2.

This commit is contained in:
szczuras4
2024-12-28 00:03:40 +01:00
parent c596494d77
commit e75b093317
553 changed files with 48087 additions and 68332 deletions

View File

@@ -136,7 +136,7 @@ namespace Invector
protected virtual void LateUpdate()
{
if (animator == null || character.currentHealth <= 0 || character.isDead || character.ragdolled || !animator.enabled || (!updateIK && animator.updateMode == AnimatorUpdateMode.Fixed)) return;
if (animator == null || (character!=null && (character.currentHealth <= 0 || character.isDead || character.ragdolled)) || !animator.enabled || (!updateIK && animator.updateMode == AnimatorUpdateMode.Fixed)) return;
updateIK = false;
// call pre Update Event
@@ -162,16 +162,16 @@ namespace Invector
xAngle = Mathf.Clamp(Mathf.Lerp(xAngle, (x), smooth * Time.deltaTime), limitAngleX.x, limitAngleX.y);
yAngle = Mathf.Clamp(Mathf.Lerp(yAngle, (y), smooth * Time.deltaTime), limitAngleY.x, limitAngleY.y);
foreach (Transform segment in spine)
for (int i = 0; i < spine.Count; i++)
{
var segment = spine[i];
var _y = NormalizeAngle(yAngle + Quaternion.Euler(offsetSpine).eulerAngles.y);
var _x = NormalizeAngle(xAngle + Quaternion.Euler(offsetSpine).eulerAngles.x);
var rotX = Quaternion.AngleAxis((_x * spineWeight) / spine.Count, segment.InverseTransformDirection(transform.right));
var rotY = Quaternion.AngleAxis((_y * spineWeight) / spine.Count, segment.InverseTransformDirection(transform.up));
segment.rotation *= rotX * rotY;
}
}
var eulerHeadOffset = Quaternion.Euler(offsetHead).eulerAngles.NormalizeAngle();
@@ -231,14 +231,14 @@ namespace Invector
{
if (LookDirectionIsOnRange(currentDir))
{
if (character.isStrafing) SmoothValues(strafeHeadWeight, strafeBodyWeight, angle.x, angle.y);
if (character != null && character.isStrafing) SmoothValues(strafeHeadWeight, strafeBodyWeight, angle.x, angle.y);
else SmoothValues(freeHeadWeight, freeBodyWeight, angle.x, angle.y);
}
else SmoothValues();
}
else
{
if (character.isStrafing) SmoothValues(strafeHeadWeight, strafeBodyWeight, angle.x, angle.y);
if (character != null && character.isStrafing) SmoothValues(strafeHeadWeight, strafeBodyWeight, angle.x, angle.y);
else SmoothValues(freeHeadWeight, freeBodyWeight, angle.x, angle.y);
}
@@ -272,10 +272,10 @@ namespace Invector
protected virtual bool IgnoreHeadTrackFromAnimator()
{
if (animatorTags.Exists(tag => IsAnimatorTag(tag)))
for (int i = 0; i < animatorTags.Count; i++)
{
return true;
}
if (IsAnimatorTag(animatorTags[i])) return true;
}
return false;
}