https://www.youtube.com/watch?v=u8qfutdEm_A
void Update()
{
GatherInput();
Move();
}
void FixedUpdate()
{
if (input_jump)
{
rb.AddForce(Vector3.up * 5, ForceMode.Impulse);
input_jump = false;
}
}
void GatherInput()
{
input_move = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical")).normalized;
if (Input.GetButtonDown("Jump"))
{
input_jump = true;
}
}
void Move()
{
Vector3 isometricDirection = new Vector3(input_move.x, 0, input_move.z);
isometricDirection = Quaternion.Euler(0, 70, 0) * isometricDirection;
rb.MovePosition(transform.position + isometricDirection * speed * Time.fixedDeltaTime);
}

부모 클래스와 자식 클래스 두 분류로만 나눠버리면,
나중에 자식이 많아졌을 때 행동을 바꾸기가 어렵다.
override나 interface를 사용하면 구현을 조금 바꿀 때 일일이 찾아가서 다 바꿔줘야 하기 때문이다.
디자인 원칙
애플리케이션에서 달라지는 부분을 찾아내고, 달라지지 않는 부분과 분리하여 캡슐화한다.
클래스(인터페이스)에서 변화하는 행동들을 골라서 변화의 종류들을 인터페이스로 묶어버리고,
클래스에선 그 인터페이스 아래에 있는 행동의 클래스들을 가져오면 코드가 좀 더 유연해진다.
디자인 원칙
상속보다는 구성을 활용한다.
구성(composition) : 두 클래스를 합치는 것