SF Tool Documentation
Search Results for

    Show / Hide Table of Contents

    Class GroundedController2D

    A physics controller for grounded characters that help implement gravity, slope mechanics, collision for platforms, and updates the MovementState while using the for custom collision callbacks.

    Inheritance
    System.Object
    Controller2D
    GroundedController2D
    PlayerController
    Inherited Members
    Controller2D.ReferenceSpeed
    Controller2D.DistanceToGround
    Controller2D.DefaultPhysics
    Controller2D.CurrentPhysics
    Controller2D.PhysicsVolumeType
    Controller2D.CharacterState
    Controller2D.PlatformFilter
    Controller2D.Direction
    Controller2D._direction
    Controller2D._directionLastFrame
    Controller2D._previousDirection
    Controller2D.OnDirectionChanged
    Controller2D.IsFrozen
    Controller2D._boxCollider
    Controller2D._rigidbody2D
    Controller2D.Bounds
    Controller2D.CollisionInfo
    Controller2D.CollisionController
    Controller2D._calculatedVelocity
    Controller2D._externalVelocity
    Controller2D.CollisionActivated
    Controller2D.Init()
    Controller2D.OnInit()
    Controller2D.OnStart()
    Controller2D.FixedUpdate()
    Controller2D.OnLateUpdate()
    Controller2D.OnPreFixedUpdate()
    Controller2D.LowerToGround()
    Controller2D.FreezeController()
    Controller2D.UnfreezeController()
    Controller2D.SetExternalVelocity(Vector2)
    Controller2D.SetDirectionalForce(Vector2)
    Controller2D.AddVelocity(Vector2)
    Controller2D.AddHorizontalVelocity(Single)
    Controller2D.AddVerticalVelocity(Single)
    Controller2D.SetVelocity(Vector2)
    Controller2D.SetHorizontalVelocity(Single)
    Controller2D.SetVerticalVelocity(Single)
    Controller2D.DebugBoxCast(Vector2, Vector2, Single, Vector2, Single, LayerMask)
    Controller2D.DebugRayCast(Vector2, Vector2, Single, LayerMask)
    Controller2D.CeilingChecks()
    Controller2D.RaycastMultiple(Vector2, Vector2, Vector2, Single, LayerMask, Int32)
    Controller2D.RaycastMultiple(Vector2, Vector2, Vector2, Single, ContactFilter2D, Int32)
    Controller2D.CheckOnCollisionActions()
    Controller2D.ChangeDirection()
    Controller2D.SetDirection(Single)
    Controller2D.OnStatusEffectChanged(StatusEffect)
    Controller2D.PositionCorection()
    Controller2D.Reset()
    Controller2D.GetColliderBounds()
    Namespace: SF.Characters.Controllers
    Assembly: cs.temp.dll.dll
    Syntax
    public class GroundedController2D : Controller2D

    Fields

    _character

    Declaration
    protected CharacterRenderer2D _character
    Field Value
    Type Description
    CharacterRenderer2D

    _modifiedColliderSize

    Declaration
    protected Vector2 _modifiedColliderSize
    Field Value
    Type Description
    Vector2

    _originalColliderSize

    Declaration
    protected Vector2 _originalColliderSize
    Field Value
    Type Description
    Vector2

    _previousColliderSize

    Declaration
    protected Vector2 _previousColliderSize
    Field Value
    Type Description
    Vector2

    _slopeNormal

    Declaration
    protected Vector2 _slopeNormal
    Field Value
    Type Description
    Vector2

    _wasGroundedLastFrame

    Declaration
    protected bool _wasGroundedLastFrame
    Field Value
    Type Description
    System.Boolean

    IsCrouching

    Declaration
    public bool IsCrouching
    Field Value
    Type Description
    System.Boolean

    IsFalling

    Declaration
    public bool IsFalling
    Field Value
    Type Description
    System.Boolean

    IsGliding

    Declaration
    public bool IsGliding
    Field Value
    Type Description
    System.Boolean

    IsGrounded

    Declaration
    public bool IsGrounded
    Field Value
    Type Description
    System.Boolean

    IsJumping

    Declaration
    public bool IsJumping
    Field Value
    Type Description
    System.Boolean

    IsRunning

    Declaration
    public bool IsRunning
    Field Value
    Type Description
    System.Boolean

    IsSwimming

    Declaration
    public bool IsSwimming
    Field Value
    Type Description
    System.Boolean

    MovingPlatformLayer

    Declaration
    protected LayerMask MovingPlatformLayer
    Field Value
    Type Description
    LayerMask

    OneWayPlatformFilter

    Declaration
    public ContactFilter2D OneWayPlatformFilter
    Field Value
    Type Description
    ContactFilter2D

    OnGrounded

    Declaration
    public Action OnGrounded
    Field Value
    Type Description
    Action

    Properties

    IsClimbing

    Declaration
    public bool IsClimbing { get; set; }
    Property Value
    Type Description
    System.Boolean

    OneWayFilterBitMask

    Declaration
    protected int OneWayFilterBitMask { get; }
    Property Value
    Type Description
    System.Int32

    StandingOnObject

    Declaration
    public GameObject StandingOnObject { get; protected set; }
    Property Value
    Type Description
    GameObject

    Methods

    CalculateHorizontal()

    Declaration
    protected override void CalculateHorizontal()
    Overrides
    Controller2D.CalculateHorizontal()

    CalculateMovementState()

    Calculates the current movement state that the player is currently in.

    Declaration
    protected override void CalculateMovementState()
    Overrides
    Controller2D.CalculateMovementState()
    Remarks

    This needs to be moved into the Controller2D parent class.

    CalculateVertical()

    Declaration
    protected override void CalculateVertical()
    Overrides
    Controller2D.CalculateVertical()

    ClimbableSurfaceChecks()

    Declaration
    protected virtual void ClimbableSurfaceChecks()

    ColisionChecks()

    Declaration
    protected override void ColisionChecks()
    Overrides
    Controller2D.ColisionChecks()

    CorrectCollisionClipping()

    If the transform translate puts us through a collider do to an off update frame for movement than correct the transform to prevent overlapping.

    Declaration
    protected override void CorrectCollisionClipping()
    Overrides
    Controller2D.CorrectCollisionClipping()

    GroundChecks()

    Declaration
    protected override void GroundChecks()
    Overrides
    Controller2D.GroundChecks()

    Move()

    Declaration
    protected override void Move()
    Overrides
    Controller2D.Move()

    OnAwake()

    Declaration
    protected override void OnAwake()
    Overrides
    Controller2D.OnAwake()

    ResetColliderSize()

    Declaration
    public void ResetColliderSize()

    ResetPhysics(MovementProperties)

    Declaration
    public override void ResetPhysics(MovementProperties movementProperties)
    Parameters
    Type Name Description
    MovementProperties movementProperties
    Overrides
    Controller2D.ResetPhysics(MovementProperties)

    ResizeCollider(Vector2)

    Declaration
    public virtual void ResizeCollider(Vector2 newSize)
    Parameters
    Type Name Description
    Vector2 newSize

    SideCollisionChecks()

    Declaration
    protected override void SideCollisionChecks()
    Overrides
    Controller2D.SideCollisionChecks()

    SlopeChecks()

    Declaration
    public virtual void SlopeChecks()

    UpdatePhysics(MovementProperties, PhysicsVolumeType)

    Declaration
    public override void UpdatePhysics(MovementProperties movementProperties, PhysicsVolumeType volumeType = null)
    Parameters
    Type Name Description
    MovementProperties movementProperties
    PhysicsVolumeType volumeType
    Overrides
    Controller2D.UpdatePhysics(MovementProperties, PhysicsVolumeType)
    In This Article
    Back to top Generated by DocFX