Presentation - Resources - Tutorials
This week's presentation can be found here
- Our own tips, tricks and best practices for working with Unity, with a bunch of gifs
- A list of external tutorials to help you with specific topics, from learning the basics to creating a certain effect.
- Get graphics, sounds, code and other free stuff from the resources page
No assignment for this week, apply these topics to your own group project.
Note: Unity can load scenes additively. This allows for different scene structures. Read more about this here: Unity Manual: Set Up Multiple Scenes
Multiple Scenes [Fold Out]
In the Hierarchy view, you can add multiple scenes to work in simultaneously.
This means that, for example, you can keep a persistent scene and load other scenes on top of it. You can use this to have scripts with persistent data and references, like Managers/Singletons, without worrying that these references break.
- GameObjects are the "physical" objects that exist in a scene.
- A GameObject can contain multiple components.
- A component can be a script, a graphics renderer, a physics tool, anything that generates a specific behaviour for an object.
- [ screenshot of components on an object ]
- Main script as identifier, and as main reference point for other components/scripts
public List<EnemyScript> spawnedEnemies;
public void SpawnEnemy()
{
EnemyScript newEnemy = Instantiate(enemyPrefab);
spawnedEnemies.Add(newEnemy);
}
[ Screenshot of EnemyScript list in Unity ]
- Observer: Events & Listeners,
- Factory: Spawned object has reference to spawnscript, spawnscript keeps list of spawned objects.
- Command: queueing? buffers
- ScriptableObjects, classes, structs.
- JSONUtility, PlayerPrefs