Notes from the KAYAC hyper-casual team
Tag: Debugging (11)

Approximating Average FPS the Easy Way
A cheap way to approximate average FPS without an array or a loop, by shrinking the running value by a fixed ratio and adding the new frame time, plus a rough variant using powers that keeps load spikes visible.
Writing Out Every Asset Reference
A Unity editor tool that writes out which assets reference which, and everything each prefab, scene and ScriptableObject pulls in: how to use it to check for unused assets or bloated scenes, how it is built on AssetDatabase.GetDependencies, and ideas for extending it.

"Which Textures Are the Big Ones?" Dumping a List of Textures
A small Unity editor script that lists every texture in a project with its estimated memory size, format and settings, so you can find oversized textures and see where the size goes.
How to Change an Android Device's Resolution with ADB, and What It's Good For
Changing a connected Android device's resolution with `adb shell wm size`, and using it to check in seconds whether a game's low frame rate comes from fill (fragment shading), what to do if it does, and what to suspect if it doesn't.
Combining C#'s ConditionalAttribute Conditions with AND and OR
How to combine several symbols with AND or OR in C#'s Conditional attribute by wrapping it in an inverted #if with a never-defined symbol, and why this works while defining a new symbol with #define does not.

The Cost of Unity's Debug.Log and the Depth of the Call Stack
An experiment showing that the time and GC Alloc of Unity's Debug.Log grow with the depth of the call stack, and what to do about it: skipping stack traces, using a lighter log, and not nesting StartCoroutine.

Sending Assets Straight from the Unity Editor to a Phone for Checking
A prototype that builds the selected prefabs into an asset bundle in the Unity Editor and sends it over Wi-Fi to an HTTP server running on a phone, so artists can check them on the device right away, with notes on the motivation, connection handling, transfer speed and shader replacement.

A Debug HTTP Server on Smartphones (2): Browsing the File Tree and Editing in Place
The second part of running a debug HTTP server inside a Unity app on a phone: browsing the StreamingAssets file tree and editing text files in the browser, with notes on generating HTML with XmlWriter, the trailing slash, listing StreamingAssets on Android, and storing a tree with JsonUtility.

Making My Debug UI Independent of UGUI with a Homemade Raycaster
How I wrote my own Raycaster so my debug UI library no longer needs a Canvas, along with the other improvements to the library: MeshRenderer drawing, alignment, nested menus, graphs, text sizing and safe area support.
Running a Debug HTTP Server on an Actual Smartphone
Running an HTTP server inside a Unity app on a smartphone so a PC browser can upload files and swap assets on the device directly, with the implementation and the open problems for using it in production.

Making Unity Debugging More Efficient with Slack
How Tokyo Prison posted screenshots, textures, logs and device information from Unity to Slack to support debugging, with sample code for each kind of post and notes on how we ran it in practice.