saraaaaras / Redo-YYY-New

0 stars 0 forks source link

Constant variables #2

Open PCRedHot opened 1 year ago

PCRedHot commented 1 year ago

https://github.com/saraaaaras/Redo-YYY-New/blob/7d2da933fc6a144d62eb12a0f94cc54c3e474cad/Assets/Inport/script/GameEngine.cs#L36-L41

These variables are constant, and in this case, static too. Use const and static to reduce memory usage and avoid unintended modification to the variables

PCRedHot commented 1 year ago

https://github.com/saraaaaras/Redo-YYY-New/blob/7d2da933fc6a144d62eb12a0f94cc54c3e474cad/Assets/Inport/script/GameEngine.cs#L32

PCRedHot commented 1 year ago

https://github.com/saraaaaras/Redo-YYY-New/blob/7d2da933fc6a144d62eb12a0f94cc54c3e474cad/Assets/Inport/script/GameEngine.cs#L25

PCRedHot commented 1 year ago

Think about the nature of the variables, and group them together in one place. It helps you to understand the logic / code more.