Third Person Cover Shooter  1.6
CoverShooter.MobileController Class Reference

Takes touch screen input and translates that to Character Motor commands. More...

Inheritance diagram for CoverShooter.MobileController:

Public Attributes

bool AlwaysAim = true
 Is the character always aiming in camera direction when not in cover. More...
 
bool AutoReload = true
 Should the controller automatically reload once the weapon magazine is empty. More...
 
float AutoAimPrecision = 30
 Maximum target angle difference for the character to aim precisely at an enemy. More...
 
float AutoAimDistance = 20
 Maximum target distance for the character to aim precisely at an enemy. More...
 
float FirePrecision = 25
 Maximum ngle difference between the current and intended orientations of the character for it to fire. More...
 
bool IsCrouching = false
 Is the character now crouching. More...
 
float PostFireDelay = 0.5f
 How long to maintain the aim direction before aiming torwards the direction of running. More...
 
CharacterSpeed Speed = CharacterSpeed.Run
 Movement speed. More...
 
GameObject Disabler
 Input is ignored when a disabler is active. More...
 
Vector3 Forward = Vector3.forward
 Forward direction relative to the camera. More...
 
bool HasMovement
 Should the movement value be used. More...
 
Vector2 Movement = Vector2.zero
 Movement direction, valid only if HasMovement is set to true. More...
 
bool HasAiming
 Should the aim value be used. More...
 
float Magnitude
 Magnitude of the aiming. More...
 
bool IsAllowedToFire
 Can attempt to fire (depending on the gun settings) when aiming. More...
 
Vector2 Aiming = Vector2.zero
 Direction to aim to, valid only if IsAiming is set to true. More...
 
GameObject ExplosionPreview
 Prefab to instantiate to display grenade explosion preview. More...
 
GameObject PathPreview
 Prefab to instantiate to display grenade path preview. More...
 

Detailed Description

Takes touch screen input and translates that to Character Motor commands.

Player input is generated using canvas objects containing components like Touch Movement or Touch Aiming. Those canvas components must be linked with the Mobile Controller. When throwing a grenade, displays a grenade preview using prefabs containing Path Preview and Explosion Preview components.

Member Data Documentation

◆ Aiming

Vector2 CoverShooter.MobileController.Aiming = Vector2.zero

Direction to aim to, valid only if IsAiming is set to true.

◆ AlwaysAim

bool CoverShooter.MobileController.AlwaysAim = true

Is the character always aiming in camera direction when not in cover.

◆ AutoAimDistance

float CoverShooter.MobileController.AutoAimDistance = 20

Maximum target distance for the character to aim precisely at an enemy.

◆ AutoAimPrecision

float CoverShooter.MobileController.AutoAimPrecision = 30

Maximum target angle difference for the character to aim precisely at an enemy.

◆ AutoReload

bool CoverShooter.MobileController.AutoReload = true

Should the controller automatically reload once the weapon magazine is empty.

◆ Disabler

GameObject CoverShooter.MobileController.Disabler

Input is ignored when a disabler is active.

◆ ExplosionPreview

GameObject CoverShooter.MobileController.ExplosionPreview

Prefab to instantiate to display grenade explosion preview.

◆ FirePrecision

float CoverShooter.MobileController.FirePrecision = 25

Maximum ngle difference between the current and intended orientations of the character for it to fire.

◆ Forward

Vector3 CoverShooter.MobileController.Forward = Vector3.forward

Forward direction relative to the camera.

◆ HasAiming

bool CoverShooter.MobileController.HasAiming

Should the aim value be used.

◆ HasMovement

bool CoverShooter.MobileController.HasMovement

Should the movement value be used.

◆ IsAllowedToFire

bool CoverShooter.MobileController.IsAllowedToFire

Can attempt to fire (depending on the gun settings) when aiming.

◆ IsCrouching

bool CoverShooter.MobileController.IsCrouching = false

Is the character now crouching.

◆ Magnitude

float CoverShooter.MobileController.Magnitude

Magnitude of the aiming.

Used for grenade angle.

◆ Movement

Vector2 CoverShooter.MobileController.Movement = Vector2.zero

Movement direction, valid only if HasMovement is set to true.

◆ PathPreview

GameObject CoverShooter.MobileController.PathPreview

Prefab to instantiate to display grenade path preview.

◆ PostFireDelay

float CoverShooter.MobileController.PostFireDelay = 0.5f

How long to maintain the aim direction before aiming torwards the direction of running.

◆ Speed

CharacterSpeed CoverShooter.MobileController.Speed = CharacterSpeed.Run

Movement speed.


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