void Awake() { rb = GetComponent <Rigidbody2D>(); TouchingGround = new Collider2D[1]; cf2D = new ContactFilter2D(); cf2D.SetLayerMask(GroundLayers); cf2DWalls = new ContactFilter2D(); cf2DWalls.SetLayerMask(WallLayers + GroundLayers); cf2D_OneSided = new ContactFilter2D(); cf2D_OneSided.SetLayerMask(OneSidedGroundLayers); TouchingGround_OneSided = new RaycastHit2D[1]; LastOneSidedGroundPoint = transform.position + Vector3.down * OneSidedGroundPoint; Ground = new CollisionPoint2D( transform, Vector3.up * GroundCheckPoint, GroundCheckRadius, GroundLayers + OneSidedGroundLayers, 1); }
void Start() { countdown = timer; GetComponent <CharacterController2D>().OnPhysicsStep += PhysicsStep; input = new ActorPlayerInput(gameObject); inpt = input; jetPack = GetComponent <Jetpack>(); LeftWallJumpPoint = new CollisionPoint2D( transform, Vector2.up * GetComponent <CharacterController2D>().CeilingCheckPoint / 2 - Vector2.right * WallJumpDistance, 0.06f, GetComponent <CharacterController2D>().GroundLayers, 1); RightWallJumpPoint = new CollisionPoint2D( transform, Vector2.up * GetComponent <CharacterController2D>().CeilingCheckPoint / 2 + Vector2.right * WallJumpDistance, 0.06f, GetComponent <CharacterController2D>().GroundLayers, 1); }