TopDown Engine v4.5
Loading...
Searching...
No Matches
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 { Movement , WeaponAim }
 the possible directions we can aim the cone at More...
Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { EveryTime , OnlyOnce }

Public Member Functions

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

Public Attributes

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

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 ( )

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: