Skip to content

Instantly share code, notes, and snippets.

View Lachee's full-sized avatar
📖
xkcd.com/1421/

Lake Lachee

📖
xkcd.com/1421/
View GitHub Profile
@Lachee
Lachee / UYAMLObjects.cs
Last active March 25, 2024 08:25
Script that can read and parse Unity YAML files into basic trees.
using Lachee.Utilities.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lachee.Utilities.Serialization
{
public interface IUPropertyCollection
@Lachee
Lachee / QuickPropertyDrawer.cs
Last active January 31, 2024 02:06
Quickly open properties with a single button click
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(Object), true)]
public class QuickPropertyDrawer : PropertyDrawer
{
const float BUTTON_SIZE = 20f;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
bool showButton = property.objectReferenceValue != null;
@Lachee
Lachee / Try.cs
Last active July 22, 2024 05:54
Proof of concept for returning errors instead of throwing.
using System;
using System.Runtime.CompilerServices;
using UnityEngine.Events;
namespace StopMission.Utilities
{
public readonly struct Result<TException>
where TException : Exception
{
public readonly TException Exception;
@Lachee
Lachee / README.md
Created May 14, 2025 03:39
Ultra-lightweight static file server to host unity builds with brotli compression.

About

Unity builds by default WebGL using brotli. This is fine, but it seems that no webserver ever knows that it needs to respond with Content-Encoding: br.

This server does that. It will detect when accessing a .br file and respond with the correct content-type and with the encoding set.

Warning

This code is not for production use. It has very little in terms of security and is only designed to verify builds are working.

DO NOT PUBLISH