TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.AIActionShoot3D Class Reference

An Action that shoots using the currently equipped weapon. If your weapon is in auto mode, will shoot until you exit the state, and will only shoot once in SemiAuto mode. You can optionnally have the character face (left/right) the target, and aim at it (if the weapon has a WeaponAim component). More...

Inheritance diagram for MoreMountains.TopDownEngine.AIActionShoot3D:
MoreMountains.Tools.AIAction

Public Types

enum  AimOrigins { Transform , SpawnPosition }
Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { EveryTime , OnlyOnce }

Public Member Functions

override void Initialization ()
 On init we grab our CharacterHandleWeapon ability.
override void PerformAction ()
 On PerformAction we face and aim if needed, and we shoot.
override void OnEnterState ()
 When entering the state we reset our shoot counter and grab our weapon.
override void OnExitState ()
 When exiting the state we make sure we're not shooting anymore.
Public Member Functions inherited from MoreMountains.Tools.AIAction
void PerformAction ()

Public Attributes

CharacterHandleWeapon TargetHandleWeaponAbility
 the CharacterHandleWeapon ability this AI action should pilot. If left blank, the system will grab the first one it finds.
bool AimAtTarget = true
 if true the Character will aim at the target when shooting
AimOrigins AimOrigin = AimOrigins.Transform
 the point to consider as the aim origin
Vector3 ShootOffset
 an offset to apply to the aim (useful to aim at the head/torso/etc automatically)
bool LockVerticalAim = false
 if this is set to true, vertical aim will be locked to remain horizontal
Public Attributes inherited from MoreMountains.Tools.AIAction
InitializationModes InitializationMode
 whether initialization should happen only once, or every time the brain is reset
string Label
 a label you can set to organize your AI Actions, not used by anything else

Protected Member Functions

virtual void MakeChangesToTheWeapon ()
 Makes changes to the weapon to ensure it works ok with AI scripts.
virtual void Update ()
 Sets the current aim if needed.
virtual void TestAimAtTarget ()
 Aims at the target if required.
virtual void Shoot ()
 Activates the weapon.
Protected Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Awake ()
 On Awake we grab our AIBrain.

Protected Attributes

CharacterOrientation3D _orientation3D
Character _character
WeaponAim _weaponAim
ProjectileWeapon _projectileWeapon
Vector3 _weaponAimDirection
int _numberOfShoots = 0
bool _shooting = false
Weapon _targetWeapon
Protected Attributes inherited from MoreMountains.Tools.AIAction
bool _initialized
AIBrain _brain

Additional Inherited Members

Properties inherited from MoreMountains.Tools.AIAction
virtual bool ActionInProgress [get, set]
virtual bool ShouldInitialize [get]

Detailed Description

An Action that shoots using the currently equipped weapon. If your weapon is in auto mode, will shoot until you exit the state, and will only shoot once in SemiAuto mode. You can optionnally have the character face (left/right) the target, and aim at it (if the weapon has a WeaponAim component).

Member Enumeration Documentation

◆ AimOrigins

Enumerator
Transform 
SpawnPosition 

Member Function Documentation

◆ Initialization()

override void MoreMountains.TopDownEngine.AIActionShoot3D.Initialization ( )
virtual

On init we grab our CharacterHandleWeapon ability.

Reimplemented from MoreMountains.Tools.AIAction.

◆ MakeChangesToTheWeapon()

virtual void MoreMountains.TopDownEngine.AIActionShoot3D.MakeChangesToTheWeapon ( )
protectedvirtual

Makes changes to the weapon to ensure it works ok with AI scripts.

◆ OnEnterState()

override void MoreMountains.TopDownEngine.AIActionShoot3D.OnEnterState ( )
virtual

When entering the state we reset our shoot counter and grab our weapon.

Reimplemented from MoreMountains.Tools.AIAction.

◆ OnExitState()

override void MoreMountains.TopDownEngine.AIActionShoot3D.OnExitState ( )
virtual

When exiting the state we make sure we're not shooting anymore.

Reimplemented from MoreMountains.Tools.AIAction.

◆ PerformAction()

override void MoreMountains.TopDownEngine.AIActionShoot3D.PerformAction ( )

On PerformAction we face and aim if needed, and we shoot.

◆ Shoot()

virtual void MoreMountains.TopDownEngine.AIActionShoot3D.Shoot ( )
protectedvirtual

Activates the weapon.

◆ TestAimAtTarget()

virtual void MoreMountains.TopDownEngine.AIActionShoot3D.TestAimAtTarget ( )
protectedvirtual

Aims at the target if required.

◆ Update()

virtual void MoreMountains.TopDownEngine.AIActionShoot3D.Update ( )
protectedvirtual

Sets the current aim if needed.

Member Data Documentation

◆ _character

Character MoreMountains.TopDownEngine.AIActionShoot3D._character
protected

◆ _numberOfShoots

int MoreMountains.TopDownEngine.AIActionShoot3D._numberOfShoots = 0
protected

◆ _orientation3D

CharacterOrientation3D MoreMountains.TopDownEngine.AIActionShoot3D._orientation3D
protected

◆ _projectileWeapon

ProjectileWeapon MoreMountains.TopDownEngine.AIActionShoot3D._projectileWeapon
protected

◆ _shooting

bool MoreMountains.TopDownEngine.AIActionShoot3D._shooting = false
protected

◆ _targetWeapon

Weapon MoreMountains.TopDownEngine.AIActionShoot3D._targetWeapon
protected

◆ _weaponAim

WeaponAim MoreMountains.TopDownEngine.AIActionShoot3D._weaponAim
protected

◆ _weaponAimDirection

Vector3 MoreMountains.TopDownEngine.AIActionShoot3D._weaponAimDirection
protected

◆ AimAtTarget

bool MoreMountains.TopDownEngine.AIActionShoot3D.AimAtTarget = true

if true the Character will aim at the target when shooting

◆ AimOrigin

AimOrigins MoreMountains.TopDownEngine.AIActionShoot3D.AimOrigin = AimOrigins.Transform

the point to consider as the aim origin

◆ LockVerticalAim

bool MoreMountains.TopDownEngine.AIActionShoot3D.LockVerticalAim = false

if this is set to true, vertical aim will be locked to remain horizontal

◆ ShootOffset

Vector3 MoreMountains.TopDownEngine.AIActionShoot3D.ShootOffset

an offset to apply to the aim (useful to aim at the head/torso/etc automatically)

◆ TargetHandleWeaponAbility

CharacterHandleWeapon MoreMountains.TopDownEngine.AIActionShoot3D.TargetHandleWeaponAbility

the CharacterHandleWeapon ability this AI action should pilot. If left blank, the system will grab the first one it finds.


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/AI/Advanced/AIActionShoot3D.cs