Skip to content

Instantly share code, notes, and snippets.

View HG-Dev's full-sized avatar

Ian M. HG-Dev

  • UTJ
  • Tokyo
View GitHub Profile
@adammyhre
adammyhre / PackageManagerHelper.cs
Last active August 11, 2025 22:42
Faster Unity Asset Importer (for use with Setup Script)
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class PackageManagerHelper {
const string ServicesNamespace = "UnityEditor.PackageManager.UI.Internal";
/// <summary>
/// Resolves a PackageManager service by its interface name.
@keijiro
keijiro / FpsCapper.cs
Last active September 24, 2025 21:29
FpsCapper - Limits the frame rate of the Unity Editor in Edit Mode
using UnityEditor;
using UnityEngine;
using UnityEngine.LowLevel;
using System.Linq;
using System.Threading;
namespace EditorUtils {
//
// Serializable settings
@runevision
runevision / BurstSDFGenerator.cs
Created September 11, 2024 07:48
Signed Distance Field generator for Unity with Burst support
/*
Based on the Anti-aliased Euclidean distance transform described by Stefan Gustavson and
Robin Strand. For further information, see https://contourtextures.wikidot.com/ and
https://web.archive.org/web/20220503051209/https://weber.itn.liu.se/~stegu/edtaa/
The algorithm is an adapted version of Stefan Gustavson's code, it inherits the copyright
statement below, which applies to this file only.
The rewrite with Unity Burst support makes the execution 40 times faster by default,
and 75 times faster if the passed in textures are both of type TextureFormat.RGBAFloat.
@bgolus
bgolus / InfiniteGrid.shader
Last active November 20, 2024 01:20
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
@DevCWJ
DevCWJ / JsonSerializeWithUniTask.cs
Last active September 14, 2023 14:12
Newtonsoft with UniTask
using System;
using System.Globalization;
using System.IO;
using System.Net.Http;
using System.Text;
using Cysharp.Threading.Tasks;
using Newtonsoft.Json;
@bitinn
bitinn / .a-unity-git-config.md
Last active April 2, 2025 07:53
My Unity git config
@danhab99
danhab99 / EventedType.cs
Last active June 22, 2017 11:54
This object and it's interface can be used to catch the accessors in an object
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ObjDB
{
public interface IEventedType<T>
{
@darktable
darktable / SavWav.cs
Created April 6, 2012 05:01
Unity3D: script to save an AudioClip as a .wav file.
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions: