TopDown Engine  v3.6
MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D Class Reference

This AIAction will rotate this AI's ConeOfVision2D either towards the AI's movement or its weapon aim direction More...

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

Public Types

enum  Modes { Modes.Movement, Modes.WeaponAim }
 the possible directions we can aim the cone at More...
 
- Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { InitializationModes.EveryTime, InitializationModes.OnlyOnce }
 

Public Member Functions

override void Initialization ()
 On init we grab our components More...
 
override void PerformAction ()
 
override void OnEnterState ()
 On entry we grab the weapon aim and cache it More...
 
- Public Member Functions inherited from MoreMountains.Tools.AIAction
virtual void OnExitState ()
 Describes what happens when the brain exits the state this action is in. Meant to be overridden. More...
 

Public Attributes

MMConeOfVision2D TargetConeOfVision2D
 the cone of vision 2D to rotate More...
 
Modes Mode = Modes.Movement
 whether to aim at the AI's movement direction or the weapon aim direction More...
 
bool Interpolate = false
 whether or not to interpolate the rotation More...
 
float InterpolateRate = 5f
 the rate at which to interpolate the rotation 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 AimCone ()
 Aims the cone at either movement or weapon aim if possible More...
 
virtual void AimAt (Vector3 direction)
 Rotates the cone, interpolating the rotation if needed More...
 
virtual void GrabWeaponAim ()
 Caches the weapon aim comp More...
 
- Protected Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Awake ()
 On Awake we grab our AIBrain More...
 

Protected Attributes

CharacterHandleWeapon _characterHandleWeapon
 
WeaponAim _weaponAim
 
TopDownController _controller
 
Vector3 _newAim
 
float _angle
 
Vector3 _eulerAngles = Vector3.zero
 
- 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

This AIAction will rotate this AI's ConeOfVision2D either towards the AI's movement or its weapon aim direction

Member Enumeration Documentation

◆ Modes

the possible directions we can aim the cone at

Enumerator
Movement 
WeaponAim 

Member Function Documentation

◆ AimAt()

virtual void MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.AimAt ( Vector3  direction)
protectedvirtual

Rotates the cone, interpolating the rotation if needed

Parameters
direction

◆ AimCone()

virtual void MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.AimCone ( )
protectedvirtual

Aims the cone at either movement or weapon aim if possible

◆ GrabWeaponAim()

virtual void MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.GrabWeaponAim ( )
protectedvirtual

Caches the weapon aim comp

◆ Initialization()

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

On init we grab our components

Reimplemented from MoreMountains.Tools.AIAction.

◆ OnEnterState()

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

On entry we grab the weapon aim and cache it

Reimplemented from MoreMountains.Tools.AIAction.

◆ PerformAction()

override void MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.PerformAction ( )
virtual

Member Data Documentation

◆ _angle

float MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D._angle
protected

◆ _characterHandleWeapon

CharacterHandleWeapon MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D._characterHandleWeapon
protected

◆ _controller

TopDownController MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D._controller
protected

◆ _eulerAngles

Vector3 MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D._eulerAngles = Vector3.zero
protected

◆ _newAim

Vector3 MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D._newAim
protected

◆ _weaponAim

WeaponAim MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D._weaponAim
protected

◆ Interpolate

bool MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.Interpolate = false

whether or not to interpolate the rotation

◆ InterpolateRate

float MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.InterpolateRate = 5f

the rate at which to interpolate the rotation

◆ Mode

Modes MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.Mode = Modes.Movement

whether to aim at the AI's movement direction or the weapon aim direction

◆ TargetConeOfVision2D

MMConeOfVision2D MoreMountains.TopDownEngine.AIActionRotateConeOfVision2D.TargetConeOfVision2D

the cone of vision 2D to rotate


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