Skip to content

Instantly share code, notes, and snippets.

@savage69kr
savage69kr / InspectorLock.cs
Created December 6, 2025 08:14 — forked from adammyhre/InspectorLock.cs
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;
@savage69kr
savage69kr / Processor.cs
Created December 6, 2025 07:46 — forked from adammyhre/Processor.cs
Generic Processing Chains
using System;
using UnityEngine;
public interface IProcessor<in TIn, out TOut> {
TOut Process(TIn input);
}
public delegate TOut ProcessorDelegate<in TIn, out TOut>(TIn input);
public class ThresholdFilter : IProcessor<float, bool> {
@savage69kr
savage69kr / CommentComponent.cs
Created April 16, 2025 13:22 — forked from yasirkula/CommentComponent.cs
Adding comments to Inspector via a component in Unity
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
[AddComponentMenu("Comment")]
public class CommentComponent : MonoBehaviour
{
#if UNITY_EDITOR
[SerializeField]
@savage69kr
savage69kr / myAngular.html
Created October 31, 2024 11:29 — forked from faustinoaq/myAngular.html
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@savage69kr
savage69kr / TinyTween.cs
Created October 13, 2024 11:29 — forked from FronkonGames/TinyTween.cs
A Complete and Easy to use Tweens library in One File.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// _____ _ _____
// |_ _|_|___ _ _ |_ _|_ _ _ ___ ___ ___
// | | | | | | | | | | | | | -_| -_| |
// |_| |_|_|_|_ | |_| |_____|___|___|_|_|
// |___|
// A Complete and Easy to use Tweens library in One File
//
// Basic use:
@savage69kr
savage69kr / groovy_script_to_copy_jobs.groovy
Created September 20, 2024 10:03 — forked from AATHITH/groovy_script_to_copy_jobs.groovy
Copy all Jobs from a view into another view | Jenkins
// Get the original view
def originalView = jenkins.model.Jenkins.instance.getView("Old-View-Name")
// Set the new view name
def newViewName = "New-View-Name"
// Check if the new view already exists
def newView = jenkins.model.Jenkins.instance.getView(newViewName)
if (newView == null) {
// If the new view does not exist, create a new ListView
@savage69kr
savage69kr / BurstSDFGenerator.cs
Created September 19, 2024 07:29 — forked from runevision/BurstSDFGenerator.cs
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.
@savage69kr
savage69kr / GpuPrinter.cginc
Created August 20, 2024 03:45 — forked from FreyaHolmer/GpuPrinter.cginc
A unity shader .cginc to draw numbers in the fragment shader - see the first comment below for example usage!
///////////////////////////////////////////////////////////////////////////////
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader
// AUTHOR: Freya Holmér
// LICENSE: Use for whatever, commercial or otherwise!
// Don't hold me liable for issues though
// But pls credit me if it works super well <3
// LIMITATIONS: There's some precision loss beyond 3 decimal places
// CONTRIBUTORS: yes please! if you know a more precise way to get
// decimal digits then pls lemme know!
// GetDecimalSymbolAt() could use some more love/precision
@savage69kr
savage69kr / GeometryUtils.cs
Created January 16, 2024 02:37 — forked from unitycoder/GeometryUtils.cs
Unity Math & Geometry Utility : ShortestAngleDistance, IsAxisAligned, FindClosestEdge, PointOnOppositeSideOfPolygon, TriangulatePolygon, ClosestTimesOnTwoLines, ClosestPointsOnTwoLineSegments, ClosestPointOnLineSegment, ClosestPolygonApproach, PointInPolygon, ProjectPointOnPlane, OrientedMinimumBoundingBox2D, PolygonsWithinRange, PolygonVertexTo…
// source: https://docs.unity3d.com/Packages/com.unity.xrtools.utils@1.4/api/Unity.XRTools.Utils.GeometryUtils.html
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.CoreUtils
{
/// <summary>
/// Utility methods for common geometric operations
@savage69kr
savage69kr / ascii_movie_image_ver_1.py
Created January 3, 2024 03:26 — forked from MotionDesignStudio/ascii_movie_image_ver_1.py
Python ASCII Video And ASCII Image Creator
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image