Skip to content

Commit

Permalink
Changed AI weapon equip behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
enviGit committed Jan 20, 2024
1 parent 5f08a7e commit 9427722
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion Assets/Scripts/Enemy/State/AiAttackTargetState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public AiStateId GetId()
}
public void Enter(AiAgent agent)
{
agent.weapons.ActiveWeapon();
agent.navMeshAgent.stoppingDistance = agent.config.attackStoppingDistance;
agent.navMeshAgent.speed = agent.config.attackSpeed;
}
Expand Down
3 changes: 3 additions & 0 deletions Assets/Scripts/Enemy/State/AiFindWeaponState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public void Update(AiAgent agent)
}
}
if (agent.weapons.HasWeapon())
{
agent.weapons.ActiveWeapon();
agent.stateMachine.ChangeState(AiStateId.FindTarget);
}
}
private Vector3 RandomNavmeshLocation(float radius, AiAgent agent)
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.9.2-beta.1
bundleVersion: 0.9.2-beta.2
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down

0 comments on commit 9427722

Please sign in to comment.