Character Shootercomponent contains a bunch of public methods that allow you to interact with how this Character will behave. It is important to notice that the Player uses another component called
Player Shooter, but it inherits from
Character Shooter, so everything available in one is available too on the other one.
eventEquipWeapon<Weapon>Event raised whenever the Character equips a weapon.
eventUnequipWeapon<Weapon>Event raised whenever it unequips a weapon.
eventChangeAmmo<Ammo>Event raised whenever it changes its type of ammo.
eventReload<Weapon, Ammo>Event raised whenever the Character reloads.
eventShoot<Weapon, Ammo>Event raised whenever the Character shoots.
eventChargedShotStart<Weapon, Ammo>Event raised whenever it starts charging.
eventChargedShotStop<Weapon, Ammo>Event raised whenever it ends a charged shot.
eventAim<bool>Event raised whenever the Character starts or stops aiming
is-and return a bool.
isAimingReturns true if the Character is aiming
isChargingShotReturns true if the Character is charging a shot
isReloadingReturns true if the Character is currently reloading the gun
isDrawingReturns true if the Character is pulling the gun
isHolsteringReturns true if the Character is holstering the gun
IEnumerator ChangeWeapon(Weapon weapon, Ammo ammo = null)
void ChangeAmmo(Ammo ammo)
void StartAiming(AimingBase aiming)
AimingBaseclass is an abstract class that requires an instance from one of the following specific classes:
AimAtTargetAims at a specific target and will keep pointing at it until told otherwise. Useful for locking in targets.
AimingCameraDirectionAims where the camera looks at. Useful for games that use the first person motor or the adventure camera motor.
AimingGroundPlaneAims where the mouse points at, along the surface of a horizontal plane surrounding the shooter. Specifically designed for top-down shooters.
AimingMuzzleForwardAims where the muzzle points.
AimingSideScrollPlaneAims where the mouse is along a vertical plane. This plane can be set along the X axis or the Z axis. Specifically designed for side scroll games.
StartChargedShot(). Otherwise it will be ignored.
ExecuteChargedShot(). Otherwise it will always return 0.
int GetAmmoInClip(string ammoID)
ammoIDis the identifier of the Ammo object.
int GetAmmoInStorage(string ammoID)
void SetAmmoToClip(string ammoID, int amount)
void AddAmmoToClip(string ammoID, int amount)
void SetAmmoToStorage(string ammoID, int amount)
void AddAmmoToStorage(string ammoID, int amount)