Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@dorodo95
dorodo95 / GenerateVectorData.cs
Last active July 11, 2023 00:20
Object Smearing via Shader
using UnityEngine;
public class GenerateVectorData : MonoBehaviour
{
private SkinnedMeshRenderer m_mesh;
private Mesh skinnedMeshCache;
private Vector3[] vertexFrameCache1;
private Vector3[] vertexFrameCache2;
private Vector3[] vertexFrameCache3;
private ComputeBuffer vertexBuffer1;
@elringus
elringus / FileWatcher.cs
Last active July 21, 2025 07:46
Allows executing an editor behaviour in response to file modificatons, even when editor application is not in focus.
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
/// <summary>
/// Uses file system watcher to track changes to specific files in the project directory.
@tolotratlt
tolotratlt / BlendCubedSkybox.shader
Last active July 6, 2024 18:12
Blending 6 sided skybox using Unity3D fragment shader
/*Blending 6 Sided skybox. By tlt*/
Shader "Skybox/VertBlendedSkybox"
{
Properties{
_Tint("Tint Color", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure("Exposure", Range(0, 8)) = 1.0
_Rotation("Rotation", Range(0, 360)) = 0
_Blend("Blend", Range(0.0,1.0)) = 0.5
@Refsa
Refsa / GrabScreenFeature.cs
Last active November 3, 2025 09:23
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings
@stonstad
stonstad / UnityUtils.cs
Created September 22, 2020 17:15
Locate Unity Assets Which Contain Broken References
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
using System.Linq;
using System.Threading.Tasks;
public class UnityUtils: MonoBehaviour
{
[MenuItem("Tools/Find Broken GUIDs")]
@korinVR
korinVR / XRPluginManagementSettings.cs
Last active January 28, 2025 15:21
Enable and disable XR Plug-in Management plugins
using System;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEditor.XR.Management.Metadata;
using UnityEngine;
namespace FrameSynthesis.XR
{
// ref. https://docs.unity3d.com/Packages/com.unity.xr.management@4.1/manual/EndUser.html
public static class XRPluginManagementSettings
@jstine35
jstine35 / SwapEditorShortcutsOnPlayerFocus.cs
Last active January 2, 2025 07:46
Resolves Editor Keyboard Behavior in Unity Player, so your game can handle CTRL and hotkeys without corrupting your scene
// Summary
// Disables Editor Keyboard Behavior when Unity Player has focus, so your game can handle CTRL and
// without corrupting your scene.
//
// Usage
// * Download or copy/paste and attach this component to a scene management object in your scene.
// * Create a new shortcut profile using Edit->Shortcuts (tedious, you need to pretty much click every
// button and remove every keystroke, one by one).
//
// Remarks
@seferciogluecce
seferciogluecce / RotateWithMouse.cs
Last active August 17, 2021 15:22
How To Rotate Camera In X Y Axes In Unity With Mouse Press | Unity 3D Tutorial at https://youtu.be/FIiKuP-9KuY
using UnityEngine;
public class RotateWithMouse : MonoBehaviour
{
public float Speed = 5;
void Update()
{
if(Input.GetMouseButton(0))
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public static class AddPlayerLoopCallback
{
// Add a callback to the PreUpdate phase
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void Setup()
{
using UnityEditor;
using UnityEngine.LowLevel;
using UnityEngine.UIElements;
public class ShowPlayerLoopWindow : EditorWindow
{
[MenuItem("Window/Player Loop")]
static void ShowWindow()
{
var wind = GetWindow<ShowPlayerLoopWindow>(false, "Player Loop");