New and improved pressure plates

A few disjoint topics this week.

Camera animation extensions. Added a bit more flexibility to the camera movement, as I had different requirements for different use-cases, e.g. for pan-and-zoom I wanted nice linear movement with constant velocity, whereas for locating a tile or a character I needed some exponential etc. So, every time I set the camera target, I also specify a few more bits of info: easing functions, maximum duration, screen-space velocity and tile velocity. That should cover everything :D As expected, did wonders to my constant reluctance to stick to something.

Pressure plate visuals. New procgen pressure plates are good, but they can be better. I've fixed a bug where they can now spawn on areas with permanent decals/overlays such as a carpet. I'm calculating the border dent colour using nearby pixels instead of a constant value, and when the plate is pressed it's a bit darker overall. All these were very useful really.

Upgrade to Unity 2021 LTS. This didn't go as smooth as hoped. Two issues:

  • System.Random cannot be serialized any more. Thankfully, a reference implementation of the class is open-source, so I used that, made it serializable and everything works like before, and algorithm seems to be the same, which is nice
  • Some shaders had vanished in builds. Apparently that was due to some weird tag discrepancy which got a (very hard to find) warning in 2021 LTS for a single shader, and that shader caused the entire shader collection to become messed up. Happy debugging times! At least found the issue, resolved the issue, and 2021 now works fine.