Skip to content

Instantly share code, notes, and snippets.

View boykopb's full-sized avatar

Pavel Boyko boykopb

View GitHub Profile
@aras-p
aras-p / unity_6_empty_web_build.md
Last active May 7, 2026 06:28
Unity 6 "empty" web build file sizes

This short post by Defold people about "empty project build size" comparison between Defold, Unity and Godot (twitter, mastodon) sparked my interest.

It is curious that Godot builds seem to be larger than Unity? Would not have expected that! Anyway.

A way more extensive Unity "web" build comparison and analysics is over at https://github.com/JohannesDeml/UnityWebGL-LoadingTest but here are just my short notes in trying out Unity 6 (6.0.23 - Oct 2024).

Default (3D, URP) template

@olegmrzv
olegmrzv / PlayerLoopCleaner.cs
Created April 4, 2024 13:07
PlayerLoop Disable Unity Modules
using System;
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public static class PlayerLoopCleaner
{
private static readonly Type[] typesToRemove = new Type[] {
typeof(EarlyUpdate.Physics2DEarlyUpdate),
// Physics 2D
@yasirkula
yasirkula / SceneViewObjectPickerContextWindow.cs
Last active April 8, 2026 11:05
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
@FronkonGames
FronkonGames / TinyTween.cs
Created October 30, 2022 23:20
A Complete and Easy to use Tweens library in One File.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// _____ _ _____
// |_ _|_|___ _ _ |_ _|_ _ _ ___ ___ ___
// | | | | | | | | | | | | | -_| -_| |
// |_| |_|_|_|_ | |_| |_____|___|___|_|_|
// |___|
// A Complete and Easy to use Tweens library in One File
//
// Basic use:
@arcueid-dev
arcueid-dev / EventValue.cs
Last active July 27, 2022 17:05
Unity EventValue. Use this to avoid additional actions. Just set value to "Value" property and if it's different from stored, then action is invoked.
[Serializable]
public class EventValue<T>
{
[SerializeField] private T _value;
private Action<T> _action;
public event Action<T> OnValueChanged
{
add
{
@dustingraham
dustingraham / ScriptableObjectWithId.cs
Created February 2, 2021 16:55
ScriptableObject with GUID
// Reference: https://github.com/Bunny83/UUID/blob/master/UUID.cs
using System;
using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
@mopsicus
mopsicus / TextGradient.cs
Last active January 26, 2026 14:44
Apply gradient to whole TMP text, but no for each character
// ----------------------------------------------------------------------------
// The MIT License
// TextGradient https://gist.github.com/mopsicus/9d344451ca614d7e9937bc0c6da2b21d
// Copyright (c) 2020 Mopsicus <mail@mopsicus.ru>
// ----------------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
@Kryzarel
Kryzarel / EasingFunctions.cs
Last active April 6, 2026 17:57
C# Easing Functions
using System;
namespace Kryz.Tweening
{
// Made with the help of this great post: https://joshondesign.com/2013/03/01/improvedEasingEquations
// --------------------------------- Other Related Links --------------------------------------------------------------------
// Original equations, bad formulation: https://github.com/danro/jquery-easing/blob/master/jquery.easing.js
// A few equations, very simplified: https://gist.github.com/gre/1650294
// Easings.net equations, simplified: https://github.com/ai/easings.net/blob/master/src/easings/easingsFunctions.ts
@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