Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 축약한 코드
- public bool IsAlive { get => gameObject.activeSelf && Hp > 0; }
- // 약간 풀어쓴 코드
- public bool IsAlive
- {
- get
- {
- return gameObject.activeSelf && Hp > 0;
- }
- }
- // 더 풀어쓴 코드
- public bool IsAlive
- {
- get
- {
- // 게임오브젝트가 활성화 되어있고 Hp가 0보다 클때 true 반환
- if ((gameObject.activeSelf) && (Hp > 0))
- return true;
- // 그 외의 경우 false 반환
- return false;
- }
- }
Add Comment
Please, Sign In to add comment