일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
- 코딩
- className
- 도린이
- click
- Quaternion
- 웹스크래핑
- topdown
- 회전
- setItem
- 종속변수
- getItem
- Event
- euler
- 탑다운
- intervals
- jQuery
- Unity
- vsCode
- 자주 사용하는 Quaternion 함수
- 도트
- 2D
- 연습
- classList
- Lerp
- PYTHON
- 독립변수
- 픽셀
- addEventListener
- wsl
- javascript
- Today
- Total
쫑가 과정
객체 지향 프로그래밍의 추상화 본문
Abstraction in object-oriented programming - Unity Learn
In this tutorial, you’ll learn about the first pillar of object-oriented programming: Abstraction. By the end of this tutorial, you will be able to: Explain how abstraction is used to expose only necessary script components Expose only the important deta
learn.unity.com
Abstraction in object-oriented programming
![](https://blog.kakaocdn.net/dn/bRXFPJ/btro6bi4HK1/8eLxaPRWKFtR4qPZ5ZVXw0/img.png)
Code refactoring - Wikipedia
From Wikipedia, the free encyclopedia Jump to navigation Jump to search Restructuring existing computer code without changing its external behavior This article is about a behaviour-preserving change. It is not to be confused with Rewrite (programming). In
en.wikipedia.org
다른 프로그래머가 볼 수 있는 스크립트에서 복잡한 코드를 제거하고 다른 프로그래머가 실제로 필요로 하는 기능만 노출한다.
코드 리팩토링의 중요한 부분
다른 프로그래머가 코드와 상호 작용하는 방식을 변경하지 않고 기능을 개선하는 것.
예) 반복해서 사용하는 기능을 메서드화 하기.
private void Start()
{
for (int i = 0; i < 3; i++)
{
Instantiate(enemyPrefab, GenerateSpawnPosition(),
enemyPrefab.transform.rotation);
}
}
=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>
void SpawnEnemyWave() // create new higher-level method
{
for (int i = 0; i < 3; i++)
{
Instantiate(enemyPrefab, GenerateSpawnPosition(),
enemyPrefab.transform.rotation);
}
}
private void Start()
{
SpawnEnemyWave(); // call higher-level method in Start()
}
메서드를 호출만 하면 기능이 작동하기에 메서드 호출을 변경하지 않는 한, 메서드 내용을 안전하게 조정할 수 있다.
자신의 응용 프로그램에 추상화를 적용하거나 시도할 수 있는 방법에 대해 생각해보자.
'Unity > 이론' 카테고리의 다른 글
(Euler) 각을 (Quaternion) 값으로 바꾸기 / Quaternion.Euler (0) | 2022.01.13 |
---|---|
두 회전 사이의 각 구하기 / Quaternion.Angle (0) | 2022.01.12 |
타겟 방향 바라보기 함수 / Quaternion.LookRotation (0) | 2022.01.12 |
벡터 연산 이해하기 (0) | 2022.01.07 |
유니티3D 회전 이해 (0) | 2022.01.06 |
객체 지향 프로그래밍의 캡슐화 (0) | 2021.12.28 |
객체 지향 프로그래밍의 상속과 다형성 (0) | 2021.12.28 |
객체 지향 프로그래밍의 원리 (0) | 2021.12.21 |