Skip to content

Instantly share code, notes, and snippets.

View y01cu's full-sized avatar

Umut Kaan Özdemir y01cu

View GitHub Profile
@yasirkula
yasirkula / CommentComponent.cs
Created November 4, 2024 19:15
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]
@FreyaHolmer
FreyaHolmer / GpuPrinter.cginc
Last active March 16, 2025 05:51
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
@yasirkula
yasirkula / SceneViewUIObjectPickerContextWindow.cs
Last active May 6, 2025 17:32
Select the UI 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.UI;
#if UNITY_2021_2_OR_NEWER
using PrefabStage = UnityEditor.SceneManagement.PrefabStage;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
@alexanderameye
alexanderameye / CircularMenu.cs
Last active April 28, 2025 08:27
Circular menu for the Unity Editor
/*
MIT License
Copyright (c) [year] [fullname]
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
@herohiralal
herohiralal / GlassShader
Created June 24, 2021 16:30
Glass shader for URP.
Shader "SimpleLit/Glass"
{
Properties
{
[MainTex] _BaseMap ("Base Map", 2D) = "white" { }
[MainColor][HDR] _Color ("Color", Color) = (1, 1, 1, 1)
_BlurStrength("Blur Strength", Range(0, 1)) = 1
_Gloss("Gloss", Range(0, 1)) = 1
_Thickness("Thickness", Range(0, 1)) = 0.5
}
@yasirkula
yasirkula / BetterWaitForSeconds.cs
Created October 13, 2019 15:54
WaitForSeconds manager that reuses instances to avoid GC in Unity
using System.Collections.Generic;
using UnityEngine;
public static class BetterWaitForSeconds
{
private class WaitForSeconds : CustomYieldInstruction
{
private float waitUntil;
public override bool keepWaiting
{