Unity Flow

Matthew·2024년 8월 14일
1

Unity

목록 보기
1/9

  1. void Awake()
  • Initializes variables and set up game states before starting the game.

void OnEnable()

  • Executes when the gameObject is enabled.

void start()

  • Happens right before the Update() part of the code

void FixedUpdate()

  • Operates in consistent "fixed" time interval
  • Uses about 50fps
  • Suitable for physics calculations, ex) applying forces to rigid body.

void Update()

  • Called "once per frame"
  • implement game logic || behaviors that needs to be updated frequently. Ex) Jump
  • Main game logic is coded in Update() such as checking for users input, updating non-obj position
  • interval b/w Update() might vary due to the environment setting. Ex) pc specs
  • deals with user input, moving obj, or update animations etc.
  • important to account for time-based operations b/w frames. Generally sovled but using Time.deltaTime method.

void LateUpdate()

  • works silmilar with Update(), but executed after Update() is finished.
  • Ex) adjusting the camer position || animations after some objects have been "updated"

void OnDisable()

  • executes when the gameObject is disabled.

void OnDestroy()

  • executes when the gameObject gets destroyed
profile
Growing Game Dev

1개의 댓글

comment-user-thumbnail
2024년 8월 15일

👍

답글 달기