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:
@@ -23,12 +23,16 @@ namespace Invector.vCharacterController.AI.FSMBehaviour
|
||||
|
||||
[vHelpBox("Use this to ignore attack time")]
|
||||
public bool forceCanAttack;
|
||||
|
||||
[Tooltip("This action will check if aim is enabled using vAnimatorTag with (Upperbody Pose) tag on layer setted")]
|
||||
public int aimLayer = 4;
|
||||
[Tooltip("The shot rountine just will run when Aim angle is in Max Angle To Shot (Inspector of vControlAIShooter>ShooterSettings")]
|
||||
public bool onlyShotWhenInAngle;
|
||||
public bool debug;
|
||||
public override void DoAction(vIFSMBehaviourController fsmBehaviour, vFSMComponentExecutionType executionType = vFSMComponentExecutionType.OnStateUpdate)
|
||||
{
|
||||
if (fsmBehaviour.aiController is vIControlAIShooter)
|
||||
{
|
||||
ControlAttack(fsmBehaviour, fsmBehaviour.aiController as vIControlAIShooter);
|
||||
ControlAttack(fsmBehaviour, fsmBehaviour.aiController as vIControlAIShooter,executionType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +60,14 @@ namespace Invector.vCharacterController.AI.FSMBehaviour
|
||||
|
||||
protected virtual void HandleAttack(vIFSMBehaviourController fsmBehaviour, vIControlAIShooter combat)
|
||||
{
|
||||
combat.AimToTarget();
|
||||
if (!combat.isAiming) return;
|
||||
combat.AimToTarget(.2f);
|
||||
bool validAimAngle = onlyShotWhenInAngle ? combat.IsInShotAngle : true;
|
||||
if (!validAimAngle || !combat.isAiming || !combat.animatorStateInfos.HasTag("Upperbody Pose") || combat.animator.IsInTransition(aimLayer) || combat.animator.GetCurrentAnimatorStateInfo(aimLayer).normalizedTime < 0.9f) return;
|
||||
if (debug)
|
||||
{
|
||||
Debug.Log("Trigger Shooter Attack");
|
||||
fsmBehaviour.SendDebug("Trigger Shooter Attack", this);
|
||||
}
|
||||
combat.Attack(forceCanAttack: forceCanAttack);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user