Super Bomber Kit
Search Results for

    Show / Hide Table of Contents

    Class PlayerBehaviourCore

    It is responsible for interconnecting all behaviors; storing global properties shared between behaviors; Collecting powerups

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    PlayerBehaviourCore
    MountableBehaviourCore
    Implements
    IPlayerBehaviourCore
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: BomberDogs.PlayerBehaviours
    Assembly: Assembly-CSharp.dll
    Syntax
    public class PlayerBehaviourCore : MonoBehaviour, IPlayerBehaviourCore

    Fields

    | Edit this page View Source

    _rigidbody

    Declaration
    public Rigidbody2D _rigidbody
    Field Value
    Type Description
    Rigidbody2D
    | Edit this page View Source

    bodyAnimator

    Declaration
    public Animator bodyAnimator
    Field Value
    Type Description
    Animator
    | Edit this page View Source

    bodyCollider

    Declaration
    public CircleCollider2D bodyCollider
    Field Value
    Type Description
    CircleCollider2D
    | Edit this page View Source

    bodySpriteRenderer

    Declaration
    public SpriteRenderer bodySpriteRenderer
    Field Value
    Type Description
    SpriteRenderer
    | Edit this page View Source

    debugAnimatorCrossFades

    Declaration
    public bool debugAnimatorCrossFades
    Field Value
    Type Description
    bool
    | Edit this page View Source

    disableControls

    Declaration
    [Header("General Tweaks")]
    [SerializeField]
    public bool disableControls
    Field Value
    Type Description
    bool
    | Edit this page View Source

    input

    Declaration
    [Header("Components")]
    public PlayerInputBase input
    Field Value
    Type Description
    PlayerInputBase
    | Edit this page View Source

    playerNumber

    Declaration
    [Header("Debug")]
    protected int playerNumber
    Field Value
    Type Description
    int
    | Edit this page View Source

    powerUps

    Declaration
    [Header("Powerups")]
    public List<EPowerUp> powerUps
    Field Value
    Type Description
    List<EPowerUp>

    Methods

    | Edit this page View Source

    AddOrConsumePowerUp(EPowerUp)

    Add or consume powerup

    Declaration
    public virtual void AddOrConsumePowerUp(EPowerUp powerUp)
    Parameters
    Type Name Description
    EPowerUp powerUp
    | Edit this page View Source

    ConsumePowerup(EPowerUp)

    Consume consumable powerups and return if this is consumable. There are consumable and stackable powerups. The consumable ones execute a method and are discarted, while the others are added to powerup list

    Declaration
    public virtual bool ConsumePowerup(EPowerUp powerUp)
    Parameters
    Type Name Description
    EPowerUp powerUp
    Returns
    Type Description
    bool
    | Edit this page View Source

    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
    public bool ControlIsDisabled()
    Returns
    Type Description
    bool

    disabled bool

    | Edit this page View Source

    CrossFade(string, float)

    Triggers crossfade in the animator. This is used by the Behavior components.

    Declaration
    public void CrossFade(string stateName, float normalizedTransitionDuration)
    Parameters
    Type Name Description
    string stateName

    Animator state name

    float normalizedTransitionDuration

    Specify time

    | Edit this page View Source

    DisableControls(bool)

    Enables or disables the control

    Declaration
    public void DisableControls(bool disable)
    Parameters
    Type Name Description
    bool disable

    disable

    | Edit this page View Source

    GetAnimator()

    Get Animator, some components need access to the animator to control animations.

    Declaration
    public Animator GetAnimator()
    Returns
    Type Description
    Animator

    animator

    | Edit this page View Source

    GetCollider()

    Obtains the input, which is the intermediary through which control commands are received.

    Declaration
    public CircleCollider2D GetCollider()
    Returns
    Type Description
    CircleCollider2D

    Collider

    | Edit this page View Source

    GetInput()

    Get sprite, some components need access to the animator to control sprites.

    Declaration
    public PlayerInputBase GetInput()
    Returns
    Type Description
    PlayerInputBase

    input

    | Edit this page View Source

    GetPowerUps()

    Get powerups. This exists because it's not possible to implement this property in the interface and this be visible in the inspector at same time.

    Declaration
    public virtual List<EPowerUp> GetPowerUps()
    Returns
    Type Description
    List<EPowerUp>
    | Edit this page View Source

    GetRigidbody()

    Get Collider, some components need access to the animator to control collisions.

    Declaration
    public Rigidbody2D GetRigidbody()
    Returns
    Type Description
    Rigidbody2D

    rigdbody 2D

    | Edit this page View Source

    GetSpriteRenderer()

    Gets the sprite renderer. This exists because it's not possible to implement this property in the interface and this be visible in the inspector at same time.

    Declaration
    public SpriteRenderer GetSpriteRenderer()
    Returns
    Type Description
    SpriteRenderer

    SpriteRenderer

    | Edit this page View Source

    InvokeOnAddPowerup(EPowerUp)

    Since the derived class cannot directly invoke an event from the basclass, we need this workaround

    Declaration
    protected void InvokeOnAddPowerup(EPowerUp powerUp)
    Parameters
    Type Name Description
    EPowerUp powerUp
    | Edit this page View Source

    IsConsumablePowerup(EPowerUp)

    Declaration
    public virtual bool IsConsumablePowerup(EPowerUp powerUp)
    Parameters
    Type Name Description
    EPowerUp powerUp
    Returns
    Type Description
    bool
    | Edit this page View Source

    OnTriggerEnter2D(Collider2D)

    Declaration
    public void OnTriggerEnter2D(Collider2D col)
    Parameters
    Type Name Description
    Collider2D col
    | Edit this page View Source

    RemovePowerup(EPowerUp)

    Declaration
    public void RemovePowerup(EPowerUp powerUp)
    Parameters
    Type Name Description
    EPowerUp powerUp
    | Edit this page View Source

    SetParent(Transform)

    Set parent. This is used by the Mount behaviour

    Declaration
    public void SetParent(Transform parentTransform)
    Parameters
    Type Name Description
    Transform parentTransform
    | Edit this page View Source

    SetPlayerNumber(int)

    Set the player number. This is defined by the level manager.

    Declaration
    public void SetPlayerNumber(int number)
    Parameters
    Type Name Description
    int number
    | Edit this page View Source

    SetPowerUps(List<EPowerUp>)

    Set the powerup list. This is used by the level manager when another level starts so that inherits the powerups acquired in a previous level.

    Declaration
    public void SetPowerUps(List<EPowerUp> powerUps)
    Parameters
    Type Name Description
    List<EPowerUp> powerUps

    Events

    | Edit this page View Source

    onAddPowerUp

    Some components need to know when a specific powerup was added

    Declaration
    public event Action<EPowerUp, PlayerBehaviourCore> onAddPowerUp
    Event Type
    Type Description
    Action<EPowerUp, PlayerBehaviourCore>
    | Edit this page View Source

    onRemovePowerUp

    Some components need to know when a specific powerup is removed

    Declaration
    public event Action<EPowerUp> onRemovePowerUp
    Event Type
    Type Description
    Action<EPowerUp>

    Implements

    IPlayerBehaviourCore

    Extension Methods

    MonoBehaviourExtensions.DelayedCall(MonoBehaviour, Action, float)
    MonoBehaviourExtensions.DelayedCallUnscaled(MonoBehaviour, Action, float)
    MonoBehaviourExtensions.LoopForAWile(MonoBehaviour, Action<float>, float, Action, bool)
    MonoBehaviourExtensions.LoopWhileReturnTrue(MonoBehaviour, Func<bool>, Action, bool)
    • Edit this page
    • View Source
    In this article
    Back to top