Skip to content

Instantly share code, notes, and snippets.

View sathyarajshetigar's full-sized avatar

Sathyaraj sathyarajshetigar

  • Ironjaw Studios Pvt. Ltd
View GitHub Profile
@FUJI-bayashi
FUJI-bayashi / RenameByAttachedImage.cs
Created April 15, 2025 21:29
Renames selected GameObjects in the Hierarchy based on their attached Sprite names from Image or SpriteRenderer components.
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
public static class RenameByAttachedImage
{
/// <summary>
/// Called from the right-click context menu in the Hierarchy when objects are selected
/// </summary>
[MenuItem("GameObject/Rename By Attached Image", false, 0)]
@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]
@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.
@MirzaBeig
MirzaBeig / SimpleAudioGenerator.cs
Created August 15, 2024 03:52
A simple procedural audio (pure sine wave) generator for Unity, using OnAudioFilterRead().
using UnityEngine;
// MB: Simple procedural audio generator.
// Generates a pure sine wave/tone at a given frequency.
public class SimpleAudioGenerator : MonoBehaviour
{
int outputSampleRate;
const float TAU = Mathf.PI * 2.0f;
@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
@markeahogan
markeahogan / InspectorCapture.cs
Created August 3, 2023 07:02
Adds method to save the whole inspector to a screenshot
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
/// <summary>
/// Provides functionality for screenshotting full editor windows, and the inspector in particular
using UnityEngine;
using System.IO;
using System;
public static class RenderTextureExtensions
{
private static DefaultDictionary<RenderTexture, Texture2D> _cachedTextures = new DefaultDictionary<RenderTexture, Texture2D>();
@ShabbirHasan1
ShabbirHasan1 / TradeTronAutoLogin.py
Last active February 7, 2023 04:28
TradeTron Auto Login
import os
import sys
import random
from time import sleep
try:
from playwright_recaptcha import recaptchav2
from playwright.sync_api import Playwright, sync_playwright, expect
except (ImportError, ModuleNotFoundError):
os.system(
@Asuta
Asuta / ScriptFileWatcher.cs
Last active January 20, 2023 09:52 — forked from elringus/ScriptFileWatcher.cs
Modify the version to be directly available, monitor all folders containing C# scripts under assets, and directly copy them to any directory under"Assets/Scritps",and You can add as many folders as you want
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace Naninovel
@devindazzle
devindazzle / SpriteWrapper.cs
Created November 29, 2022 10:56
This component will mirror a sprite renderer and create a sprite wrapping effect at the edges of the screen similar to the game Asteroids. To use the component, add it to the same game object as the sprite renderer you want to mirror and it just works. Optionally, you can set the warp property to true and the game object will warp to the opposit…
using UnityEngine;
[RequireComponent(typeof(SpriteRenderer))]
public class SpriteWrapper : MonoBehaviour {
[Header("Sprite Wrapper")]
[Tooltip("Should sprite be wrapped when reaching the edge of the screen?"), SerializeField]
private bool wrap;