public void ReadyClimb() { ChangeLayer(Ladder.GetFloor(UpDown) + (UpDown ? 1 : -1)); Rb.velocity = Vector2.zero; Vector3 pos = Main.position; Main.position = new Vector3(Ladder.DownPos.position.x + Mathf.Abs(GetComponent <Collider2D>().offset.x) * (Side ? 1 : -1), pos.y, pos.z); Hook = gameObject.AddComponent <FixedJoint2D>(); OnLadder = true; }
public void FinishClimb() { ChangeLayer(Ladder.GetFloor(UpDown)); Destroy(Hook); OnLadder = false; }