Corgi Engine  v8.8
MoreMountains.CorgiEngine.AIActionShoot 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.CorgiEngine.AIActionShoot:
MoreMountains.Tools.AIAction

Public Member Functions

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

Public Attributes

bool FaceTarget = true
 if true, the Character will face the target (left/right) when shooting More...
 
bool AimAtTarget = false
 if true the Character will aim at the target when shooting More...
 
Vector3 TargetOffset = Vector3.zero
 a constant offset to apply to the target's position when aiming : 0,1,0 would aim more towards the head, for example More...
 
CharacterHandleWeapon TargetHandleWeapon
 the ability to pilot More...
 
- Public Attributes inherited from MoreMountains.Tools.AIAction
InitializationModes InitializationMode
 
string Label
 a label you can set to organize your AI Actions, not used by anything else More...
 

Protected Member Functions

virtual void Update ()
 Sets the current aim if needed More...
 
virtual void TestFaceTarget ()
 Faces the target if required More...
 
virtual void TestAimAtTarget ()
 Aims at the target if required More...
 
virtual void Shoot ()
 Activates the weapon More...
 
- Protected Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Awake ()
 On Awake we grab our AIBrain More...
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { InitializationModes.EveryTime, InitializationModes.OnlyOnce }
 
- 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 Function Documentation

◆ Initialization()

override void MoreMountains.CorgiEngine.AIActionShoot.Initialization ( )
virtual

On init we grab our CharacterHandleWeapon ability

Reimplemented from MoreMountains.Tools.AIAction.

◆ OnEnterState()

override void MoreMountains.CorgiEngine.AIActionShoot.OnEnterState ( )
virtual

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

Reimplemented from MoreMountains.Tools.AIAction.

◆ OnExitState()

override void MoreMountains.CorgiEngine.AIActionShoot.OnExitState ( )
virtual

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

Reimplemented from MoreMountains.Tools.AIAction.

◆ PerformAction()

override void MoreMountains.CorgiEngine.AIActionShoot.PerformAction ( )
virtual

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

Implements MoreMountains.Tools.AIAction.

◆ Shoot()

virtual void MoreMountains.CorgiEngine.AIActionShoot.Shoot ( )
protectedvirtual

Activates the weapon

◆ TestAimAtTarget()

virtual void MoreMountains.CorgiEngine.AIActionShoot.TestAimAtTarget ( )
protectedvirtual

Aims at the target if required

◆ TestFaceTarget()

virtual void MoreMountains.CorgiEngine.AIActionShoot.TestFaceTarget ( )
protectedvirtual

Faces the target if required

◆ Update()

virtual void MoreMountains.CorgiEngine.AIActionShoot.Update ( )
protectedvirtual

Sets the current aim if needed

Member Data Documentation

◆ _character

Character MoreMountains.CorgiEngine.AIActionShoot._character
protected

◆ _numberOfShoots

int MoreMountains.CorgiEngine.AIActionShoot._numberOfShoots = 0
protected

◆ _projectileWeapon

ProjectileWeapon MoreMountains.CorgiEngine.AIActionShoot._projectileWeapon
protected

◆ _shooting

bool MoreMountains.CorgiEngine.AIActionShoot._shooting = false
protected

◆ _weaponAim

WeaponAim MoreMountains.CorgiEngine.AIActionShoot._weaponAim
protected

◆ _weaponAimDirection

Vector3 MoreMountains.CorgiEngine.AIActionShoot._weaponAimDirection
protected

◆ AimAtTarget

bool MoreMountains.CorgiEngine.AIActionShoot.AimAtTarget = false

if true the Character will aim at the target when shooting

◆ FaceTarget

bool MoreMountains.CorgiEngine.AIActionShoot.FaceTarget = true

if true, the Character will face the target (left/right) when shooting

◆ TargetHandleWeapon

CharacterHandleWeapon MoreMountains.CorgiEngine.AIActionShoot.TargetHandleWeapon

the ability to pilot

◆ TargetOffset

Vector3 MoreMountains.CorgiEngine.AIActionShoot.TargetOffset = Vector3.zero

a constant offset to apply to the target's position when aiming : 0,1,0 would aim more towards the head, for example


The documentation for this class was generated from the following file: