Posted March 18, 2020 by Cable Stayed Studios
Whats new?
Dealing system
When a student is low on supply, it sends a request to the student manager to arrange a deal. The Student Manager takes into consideration all students who are currently selling, all the spots where deals can happen, and at what time the deal can happen. The manager also looks at pending deals so there are no overlap in spot/time and time/dealer. After the deal details have been finalized, it is sent to both the buyer and seller.
X Ray Shader
Originally the school had nor roof and no outside walls. I thought it would look fine once the outside environment was put into place. But then I was watching some videos on shaders and a video about sphere masks came up (https://www.youtube.com/watch?v=Ws4ukvCgTOU&t=61s). I always looking for ways to work on my shader skills so I decided to implement a sphere mask shader that modifies the materials alpha value, to give the impression that the walls and ceiling around the player dissolved away so you can see inside.
This shader was build using Unity's Shader Graph. You can see the whole shader graph in the images section. Every object that will dissolve away when the player is nearby is painted with a material that has the X Ray shader on it, and is attached with an XRayable script. A controller script called XRay updates every child's XRayable with the player's and cursor's position, and XRayable updates the material.
In the future, I will rewrite the shader using ShaderLab so I can utilize global variables for the player's and cursor's location. There are hundreds of XRayable objects, so iterating over every one of them every update is costly.