Skip to content

Instantly share code, notes, and snippets.

@flarb
flarb / VRInputModule.cs
Created August 20, 2014 22:27
Lets you use a VR world space cursor with World Space Canvases in Unity3D 4.6. Add this to the EventSystem object. Put some box colliders on your buttons in the World Space Canvas. Then, do a trace to see if you're looking at a menu object--if the trace hits one of those buttons, pass it to SetTargetObject. See ralphbarbagallo.com for a longer e…
using UnityEngine;
using UnityEngine.EventSystems;
//by Ralph Barbagallo
//www.flarb.com
//www.ralphbarbagallo.com
//@flarb
public class VRInputModule : BaseInputModule {
@StagPoint
StagPoint / OuterGlow.cs
Last active March 16, 2025 08:15
Custom VisualElement for Unity's UI Toolkit which is useful for creating an "outer glow" effect for buttons, or a "drop shadow" effect for popups, windows, and dialogs.
// Created 2024 StagPoint. Released to the public domain.
using System;
using System.Runtime.CompilerServices;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Scripting;
using UnityEngine.UIElements;
@paralin
paralin / minimize-go-wasm-size.md
Last active September 27, 2024 08:13
Minimizing Go wasm binaries size: a multi-pronged approach

My approach to smaller Go wasm binaries:

  • protoc-gen-go-lite: Removes dependency on reflection, making your binaries lighter.
  • goweight: Analyze the size of your binaries. This is a fork with added wasm support.
  • goda: Use to find why something is imported by executing:
    goda graph "reach(.:all, gonum.org/v1/gonum/mat)" | dot -Tsvg -o graph.svg
    
  • wasm-opt: Optimize wasm binaries for size with the command: