728x90
public class LifeCycle
{
    //최초실행
    void Awake()
    {
        Debug.WriteLine("플레이어 데이터가 준비되었습니다");
    }
    //게임 오브젝트가 활성화 되었을떄 / 켜고 끌때마다 실행
    void OnEnable()
    {
        Debug.WriteLine("플레이어 로그인");
    }
    void Start()
    {
        Debug.WriteLine("사냥 장비를 챙겼습니다");
    }

    //물리연산 업데이트 / 1초에 50번정도
    void Fixedupdate()
    {
        Debug.WriteLine("이동");
    }
    //게임로직 업데이트 / 환경에따라 실행주기가 떨어짐
    void Update()
    {
        Debug.WriteLine("몬스터사냥");
    }


    //모든 업데이트 끝난후 / 카메라나 후처리
    void LateUpdate()
    {
        Debug.WriteLine("경험치 획득");
    }

    //게임 오브젝트가 비활성화 될때
    void OnDisable()
    {
        Debug.WriteLine("플레이어 로그아웃");
    }

    //오브젝트가 삭제될때 / 뭔갈 남길때
    void OnDestroy()
    {
        Debug.WriteLine("플레이어 데이터를 해체하였습니다");
    }
}
728x90

'c#' 카테고리의 다른 글

[C#] 무명 메서드  (0) 2023.01.25
LiveCharts 코드 비하인드  (0) 2023.01.19
System.Windows.Baml2006.TypeConverterMarkupExtension  (0) 2023.01.17
TDD(Test Driven Development)  (0) 2023.01.17
[Console] 반짝이  (0) 2023.01.17
Posted by 바르마스
,