SHARE
TWEET

Untitled

KomastarDev May 29th, 2020 698 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //  축약한 코드
  2. public bool IsAlive { get => gameObject.activeSelf && Hp > 0; }
  3. //  약간 풀어쓴 코드
  4. public bool IsAlive
  5. {
  6.     get
  7.     {
  8.         return gameObject.activeSelf && Hp > 0;
  9.     }
  10. }
  11. //  더 풀어쓴 코드
  12. public bool IsAlive
  13. {
  14.     get
  15.     {
  16.         //  게임오브젝트가 활성화 되어있고 Hp가 0보다 클때 true 반환
  17.         if ((gameObject.activeSelf) && (Hp > 0))
  18.             return true;
  19.         //  그 외의 경우 false 반환
  20.         return false;
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top