Skip to content

Instantly share code, notes, and snippets.

View kgs0142's full-sized avatar
๐Ÿ—

Victor Lee kgs0142

๐Ÿ—
View GitHub Profile
@yasirkula
yasirkula / UnityQRCodeGenerator.cs
Created June 15, 2024 23:32
Generate QR codes inside Unity
/// = Sources =
/// https://github.com/codebude/QRCoder
/// https://github.com/codebude/QRCoder.Unity
///
/// = License =
/// The MIT License (MIT)
///
/// Copyright(c) 2013 - 2018 Raffael Herrmann
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy of
@yasirkula
yasirkula / SnapRectTransformAnchorsToCorners.cs
Created May 28, 2024 18:20
Snap a RectTransform's anchors to its corner points in Unity
using UnityEditor;
using UnityEngine;
public class SnapRectTransformAnchorsToCorners : MonoBehaviour
{
[MenuItem("CONTEXT/RectTransform/Snap Anchors To Corners", priority = 50)]
private static void Execute(MenuCommand command)
{
RectTransform rectTransform = command.context as RectTransform;
RectTransform parent = rectTransform.parent as RectTransform;
@yasirkula
yasirkula / SceneViewObjectPickerContextWindow.cs
Last active March 9, 2026 14:29
Select the object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.Pool;
using UnityEngine.UI;
public class SceneViewObjectPickerContextWindow : EditorWindow
@torcado194
torcado194 / cleanEdge-shadertoy.glsl
Last active March 15, 2026 02:42
cleanEdge, a pixel art upscaling algorithm for clean rotations
/*** MIT LICENSE
Copyright (c) 2022 torcado
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
@yasirkula
yasirkula / WavyImage.cs
Last active January 23, 2026 18:43
Create UI image with wave animation in Unity
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Sprites;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
#if UNITY_EDITOR
using UnityEditor;
@yasirkula
yasirkula / BatchExtractMaterials.cs
Last active November 18, 2025 13:44
Batch extract materials from 3D model assets in Unity
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
public class BatchExtractMaterials : EditorWindow
{
private enum ExtractMode { Extract = 0, Remap = 1, Ignore = 2 };
[System.Serializable]
@yasirkula
yasirkula / ConvertTexturesToPNG.cs
Last active February 2, 2026 17:31
Convert all TGA, TIFF, PSD and BMP (customizable) Textures to PNG to reduce the project size without any quality loss in Unity
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
@yasirkula
yasirkula / DuplicateAssetDetector.cs
Last active September 1, 2025 15:29
Find duplicate assets in Unity
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using Object = UnityEngine.Object;
@yasirkula
yasirkula / MultiScreenshotCapture.cs
Last active February 23, 2026 12:18
Capture multiple screenshots with different resolutions simultaneously in Unity 3D
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace MultiScreenshotCaptureNamespace
{
internal static class ReflectionExtensions
@yasirkula
yasirkula / UnitypackageExtractor.cs
Last active December 6, 2025 21:13
Extract a .unitypackage to any directory (even outside the project folder) from within Unity
#define STOP_EXTRACTION_WHEN_WINDOW_CLOSED
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Text;
using System.Threading;
using UnityEditor;