Interface IPlayerBehaviourCore
This component is responsible for unifying all Behavior Components. Using interface ensures decoupling.
Namespace: BomberDogs.PlayerBehaviours
Assembly: Assembly-CSharp.dll
Syntax
public interface IPlayerBehaviourCore
Methods
| Edit this page View SourceAddOrConsumePowerUp(EPowerUp)
Increase powerup. When there is a collision with a powerup, it will be added through here.
Declaration
void AddOrConsumePowerUp(EPowerUp powerUp)
Parameters
| Type | Name | Description |
|---|---|---|
| EPowerUp | powerUp |
ControlIsDisabled()
checks if the character's control is enabled.. Disabling character control is useful in some scenes. Also, if the character is using a mount, their control is disabled so that they remain on top of the mount.
Declaration
bool ControlIsDisabled()
Returns
| Type | Description |
|---|---|
| bool | disabled bool |
CrossFade(string, float)
Triggers crossfade in the animator. This is used by the Behavior components.
Declaration
void CrossFade(string stateName, float normalizedTransitionDuration)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stateName | Animator state name |
| float | normalizedTransitionDuration | Specify time |
DisableControls(bool)
Enables or disables the control
Declaration
void DisableControls(bool disable)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disable | disable |
GetAnimator()
Get Animator, some components need access to the animator to control animations.
Declaration
Animator GetAnimator()
Returns
| Type | Description |
|---|---|
| Animator | animator |
GetCollider()
Get Collider, some components need access to the animator to control collisions.
Declaration
CircleCollider2D GetCollider()
Returns
| Type | Description |
|---|---|
| CircleCollider2D | rigdbody 2D |
GetComponent<T>()
Access to get component. Since we are in an interface we need to redeclare this.
Declaration
T GetComponent<T>()
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetInput()
Obtains the input, which is the intermediary through which control commands are received.
Declaration
PlayerInputBase GetInput()
Returns
| Type | Description |
|---|---|
| PlayerInputBase | Collider |
GetPowerUps()
Get powerups, some components need this to know if specific power up is enabled.
Declaration
List<EPowerUp> GetPowerUps()
Returns
| Type | Description |
|---|---|
| List<EPowerUp> |
GetRigidbody()
Get Rigidbody, some components need access to the animator to control physics.
Declaration
Rigidbody2D GetRigidbody()
Returns
| Type | Description |
|---|---|
| Rigidbody2D |
GetSpriteRenderer()
Get sprite, some components need access to the animator to control sprites.
Declaration
SpriteRenderer GetSpriteRenderer()
Returns
| Type | Description |
|---|---|
| SpriteRenderer | input |
IsConsumablePowerup(EPowerUp)
Declaration
bool IsConsumablePowerup(EPowerUp powerUp)
Parameters
| Type | Name | Description |
|---|---|---|
| EPowerUp | powerUp |
Returns
| Type | Description |
|---|---|
| bool |
SetParent(Transform)
Defines the parent. Required in some Behaviour components. Especially for mountables.
Declaration
void SetParent(Transform parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | parent | parent transform |
SetPlayerNumber(int)
Set player number. This is used by LevelManager
Declaration
void SetPlayerNumber(int number)
Parameters
| Type | Name | Description |
|---|---|---|
| int | number | player number |
Events
| Edit this page View SourceonAddPowerUp
Some components need to know when a specific powerup was added
Declaration
event Action<EPowerUp, PlayerBehaviourCore> onAddPowerUp
Event Type
| Type | Description |
|---|---|
| Action<EPowerUp, PlayerBehaviourCore> |
onRemovePowerUp
Some components need to know when a specific powerup is removed
Declaration
event Action<EPowerUp> onRemovePowerUp
Event Type
| Type | Description |
|---|---|
| Action<EPowerUp> |