TopDown Engine
v3.6
|
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...
Public Types | |
enum | AimOrigins { AimOrigins.Transform, AimOrigins.SpawnPoint } |
Public Types inherited from MoreMountains.Tools.AIAction | |
enum | InitializationModes { InitializationModes.EveryTime, InitializationModes.OnlyOnce } |
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 | |
CharacterHandleWeapon | TargetHandleWeaponAbility |
the CharacterHandleWeapon ability this AI action should pilot. If left blank, the system will grab the first one it finds. More... | |
AimOrigins | AimOrigin = AimOrigins.Transform |
the origin we'll take into account when computing the aim direction towards the target More... | |
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... | |
bool | OnlyAimWhenInState = false |
whether or not to only perform aim when in this state 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 | MakeChangesToTheWeapon () |
Makes changes to the weapon to ensure it works ok with AI scripts 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 | |
CharacterOrientation2D | _orientation2D |
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 | |
Properties inherited from MoreMountains.Tools.AIAction | |
virtual bool | ActionInProgress [get, set] |
virtual bool | ShouldInitialize [get] |
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).
|
virtual |
On init we grab our CharacterHandleWeapon ability
Reimplemented from MoreMountains.Tools.AIAction.
|
protectedvirtual |
Makes changes to the weapon to ensure it works ok with AI scripts
|
virtual |
When entering the state we reset our shoot counter and grab our weapon
Reimplemented from MoreMountains.Tools.AIAction.
|
virtual |
When exiting the state we make sure we're not shooting anymore
Reimplemented from MoreMountains.Tools.AIAction.
|
virtual |
On PerformAction we face and aim if needed, and we shoot
Implements MoreMountains.Tools.AIAction.
|
protectedvirtual |
Activates the weapon
|
protectedvirtual |
Aims at the target if required
|
protectedvirtual |
Faces the target if required
|
protectedvirtual |
Sets the current aim if needed
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.TopDownEngine.AIActionShoot2D.AimAtTarget = false |
if true the Character will aim at the target when shooting
AimOrigins MoreMountains.TopDownEngine.AIActionShoot2D.AimOrigin = AimOrigins.Transform |
the origin we'll take into account when computing the aim direction towards the target
bool MoreMountains.TopDownEngine.AIActionShoot2D.FaceTarget = true |
if true, the Character will face the target (left/right) when shooting
bool MoreMountains.TopDownEngine.AIActionShoot2D.OnlyAimWhenInState = false |
whether or not to only perform aim when in this state
CharacterHandleWeapon MoreMountains.TopDownEngine.AIActionShoot2D.TargetHandleWeaponAbility |
the CharacterHandleWeapon ability this AI action should pilot. If left blank, the system will grab the first one it finds.