Study Guide
Study Guide
through the job system. Coroutines are the usual workaround, which use yield wait
to trigger from the main thread
Thread Safety:
Only main thread can modify texture at runtime because it lives in GPU
Threads cannot move a game object by position/rotation because fetching transform
is not thread safe
Single-responsibility principle
Classes should exist to do one thing and only one thing
Open-closed principle
(Generally) design classes to be open for extension, closed for modification.
(Exceptions for design patterns like StateMachine?)
A Singleton can/should only exist once - multiple instance will break it and should
be never necessary (IE Physics System). Considered bad practice in Unity due to low
upfront costs but higher as time goes on, as it tends to get code more tightly
coupled
Static keyword - share among all objects of the class, doesn't need (or can have)
an instance to reference
Class - Reference type, references/points to variable data (change one, change all)
Struct - Value type, directly contains variable data (change one, just that one)
-Pathfinding-
Awake - Initialize
OnEnable
Start - Only once
FixedUpdate
Update
LateUpdate - before rendering
OnGUI
OnApplicationPause
OnApplicationQuit
OnDisable
OnDestroy
TCP vs UDP:
TCP is connection-oriented, slow but guaranteed, used by critical applications.
TCP/IP is used to connect directly with machines outside of the internet.
UDP is connectionless, fast but NO guarantee of transmission, making it less
consistently reliable. Used by Real-Time Applications that want to stay up to date
as much as possible but can afford to miss updates (displaying graphics / UI)