Month 2: Week 1
- Liston Harding
- Feb 5, 2017
- 1 min read
Introduction
It's Month two, end of the first week of production! This week for me has been about optimization and bug fixing.
Optimization
As a team we've learned that staying away from Unity's Update function(which updates the game every frame) is a must as designing our code with heavy use of the Update function will cause our game to run faster or slower on someone else's machine. We've decided to manage our own time whenever possible by using coroutines which by Unity's definition: :"A coroutine is like a function that has the ability to pause execution and return control to Unity but then to continue where it left off on the following frame"; moreover this gets rid of the problem of our game running faster or slower on other computers.
New Weapon Controller
I've redesigned the Weapon Controller(the script in charge of managing the main weapon) last months designed was a bit nonintuitive in the way it handle weapon parts. The Weapon Controller handled gun parts in a way that used and index to activate gun parts in the weapon pool, which was code heavy. This week I've designed it in a way that takes advantage of Unity's prefabs, this way if I wanted to create 10 new gun parts it would only take about fifteen minutes whereas before it would be close to two hours.
Comments