Unity tips
Random tips
-
GameManager.cs script and Game Manager Empty Object.
See lesson.
and then
gameManager = GameObject.Find("Game Manager").GetComponent<GameManager>();
from lesson.
-
Getting Rigidbody for self
targetRb = GetComponent<Rigidbody>();
See lesson.
-
Coroutines
StartCoroutine
See lesson.
-
GameObject of self is just
gameObject
See lesson.
-
ParticleSystem
Make it public, assign in GUI, and call
Instantiate
when needed. See lesson. -
Canvas and Text Mesh Pro and Anchor Points
See lesson.
-
AddListener
on buttonsSee lesson.
-
Nested Prefabs
See lesson.
-
Persist volume level between restarts (scene reloads)
Use static variable to store the value.
-
Pausing the game
See that article.
- Cick-and-Swipe
See guide.
- SerializeField
Makes (private) variable visible in Editor. See lesson.
FixedUpdate
andLateUpdate
FixedUpdate
– to calculate physics and movement, LateUpdate
– to calc camera movement.
From lesson.
Awake
andStart
See lesson.