This week I worked on implementing the Guiding Line Tool for GUS and also a shader for showing the flow of power in wires. The wires are not implemented at the moment however I still added in the shader and required functionality to show the power flow.
Guiding Line Implementation
I implemented the guiding line by simply adding the Render Line component and Guiding Line script i created for this functionality earlier on. I had to add some extra functionality into the Voice Commands for the game and then call the script correctly and pass into the script a game object of which object was being said. I used this time to change up some of the voice commands code to make it more efficient and remove one bug within the object selection.
Power Flow
I began working on the power flow tasks by creating a power flow shader. This shader is emmissive. This means it produces light and effects nearby objects lighting. This took quite some time to get right. Since the shader was also moving I needed to update the emission texture as this does not usually happen. I created a script and limited the update to once every half a second to ensure performance was not affected too much as this is a taxing task.
I then also created the functionality for starting and stopping the power flow shader. A dictionary of wire components was added to keep track of all the wires that needed this functionality and it is updated with the power flow shader or normal shader depending on which action the user has taken. One piece of functionality not added yet is setting all objects being static to display the power shaders emmissive lights. Since the scene is not fully finished, this was left as there could be more moving parts in before it is finished and setting objects to static may affect the project.
Issues
This week I had an issue with git reverting part of my work with the power flow shader. I had to redo this shader and I couldnt get it back to exactly what it was before just yet. This was extremely annoying but it was my own fault. I have since also spent time reading up on git documentation to ensure nothing like this happens again.