Class MovementController
Inheritance
MovementController
Inherited Members
Component.GetComponentInChildren<T>()
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DestroyObject(Object)
Assembly: LobsterFramework.dll
Syntax
[RequireComponent(typeof(Rigidbody2D))]
public class MovementController : MonoBehaviour
Fields
|
Improve this Doc
View Source
OnMovementBlocked
Event that occurs when movement status is changed
Declaration
public Action<bool> OnMovementBlocked
Field Value
|
Improve this Doc
View Source
moveSpeedModifier
Modifies movespeed, base value is 1
Declaration
public readonly FloatProduct moveSpeedModifier
Field Value
|
Improve this Doc
View Source
movementLock
Manages movement blocking and unblocking. Add true values to block movement, remove all true values to unblock.
Declaration
public readonly OrValue movementLock
Field Value
|
Improve this Doc
View Source
rotateSpeedModifier
Modifies rotate speed, base value is 1
Declaration
public readonly FloatProduct rotateSpeedModifier
Field Value
Properties
|
Improve this Doc
View Source
MovementBlocked
Declaration
public bool MovementBlocked { get; }
Property Value
|
Improve this Doc
View Source
RigidBody
Declaration
public Rigidbody2D RigidBody { get; }
Property Value
|
Improve this Doc
View Source
RotateSpeed
Declaration
public float RotateSpeed { get; }
Property Value
|
Improve this Doc
View Source
Speed
Declaration
public float Speed { get; }
Property Value
Methods
|
Improve this Doc
View Source
ApplyForce(Vector2, float)
Declaration
public void ApplyForce(Vector2 direction, float magnitude)
Parameters
|
Improve this Doc
View Source
DisableCollider()
Declaration
public void DisableCollider()
|
Improve this Doc
View Source
EnableCollider()
Declaration
public void EnableCollider()
|
Improve this Doc
View Source
IgnoreCollision(Collider2D, bool)
Declaration
public void IgnoreCollision(Collider2D collider, bool ignore = true)
Parameters
|
Improve this Doc
View Source
KinematicBody(bool)
Declaration
public void KinematicBody(bool isKinematic)
Parameters
Type |
Name |
Description |
bool |
isKinematic |
|
|
Improve this Doc
View Source
MoveInDirection(Vector2, float)
Start moving the entity towards the specified direction, will fail if Movement is blocked on this entity
Declaration
public void MoveInDirection(Vector2 direction, float acceleration = 1)
Parameters
|
Improve this Doc
View Source
RotateByDegrees(float)
Attempt to rotate the entity by the specified degree. If the specified angle is larger than the max rotation speed,
the entity will rotate towards target angle will max speed. Will fail if Movement blocked.
Declaration
public void RotateByDegrees(float degree)
Parameters
Type |
Name |
Description |
float |
degree |
The degree to rotate the entity by
|
|
Improve this Doc
View Source
RotateForwardDirection(Vector2)
Attempt to rotate the entity towards the specified direction. If the angle needed is larger than the max rotation speed,
the entity will rotate towards target angle will max speed. Do nothing if movement is blocked.
Declaration
public void RotateForwardDirection(Vector2 direction)
Parameters
Type |
Name |
Description |
Vector2 |
direction |
The target direction to rotate towards
|
|
Improve this Doc
View Source
SetVelocity(Vector2)
Declaration
public void SetVelocity(Vector2 velocity)
Parameters
Type |
Name |
Description |
Vector2 |
velocity |
|
|
Improve this Doc
View Source
Declaration
public void SetVelocityImmediate(Vector2 velocity)
Parameters
Type |
Name |
Description |
Vector2 |
velocity |
|