Skip to content

Instantly share code, notes, and snippets.

@FreyaHolmer
FreyaHolmer / AssetCopyUtils.cs
Last active June 12, 2024 07:25
Adds context menu items to assets: Copy/Paste import settings & Copy GUID. Put this script in any Editor/ folder in your project and recompile!
// written by https://github.com/FreyaHolmer so use at your own risk c:
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/// <summary>Utility functions to copy GUIDs, as well as Copy/Paste import settings</summary>
public static class AssetCopyUtils {
const int CTX_MENU_LOCATION = 70;
@passivestar
passivestar / Editor.tres
Last active April 10, 2024 20:07
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@larssteenhoff
larssteenhoff / DistantPixelize.cs
Created September 23, 2023 23:06 — forked from joshcamas/DistantPixelize.cs
Distant Pixelize Renderer (Using SCPE)
#if URP
using UnityEngine.Rendering.Universal;
#endif
using System;
using UnityEngine;
using UnityEngine.Rendering;
using SCPE;
namespace Ardenfall.Effects
@joshcamas
joshcamas / shader_distantpixelize.shader
Last active September 23, 2023 23:00
Distant Pixelize Unity Effect
Shader "Ardenfall/Effects/DistantPixelize"
{
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
float _MaxPixelSize;
float _MinPixelSize;
float _MaxDistance;
@kamyker
kamyker / HideTitleMenuBar.cs
Created December 23, 2022 23:54
Unity C# hide tool bar and menu bar for light panel in dark mode
#if UNITY_EDITOR
using System;
using System.Runtime.InteropServices;
using System.Text;
using UnityEditor;
using UnityEngine;
public static class HideTitleMenuBar
{
[DllImport("user32.dll")]
@aras-p
aras-p / ExportDDS.cs
Last active June 6, 2024 02:21
Unity DDS file exporter for compressed textures
// Adds context menu to TextureImporter objects, saves .dds next to input texture, including mipmaps.
// Tested with Unity 2021.3.4
using System;
using UnityEngine;
using UnityEditor;
using System.IO;
using Unity.Collections.LowLevel.Unsafe;
struct DDSHeader
@staggartcreations
staggartcreations / GlobalShaderParams.cs
Last active January 18, 2024 08:40
Component for passing values through Shader.SetGlobalXXX
using System;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteInEditMode]
public class GlobalShaderParams : MonoBehaviour
{
@yasirkula
yasirkula / ConvertTexturesToPNG.cs
Last active July 22, 2024 14:18
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;
/*
A simple little editor extension to copy and paste all components
Help from http://answers.unity3d.com/questions/541045/copy-all-components-from-one-character-to-another.html
license: WTFPL (http://www.wtfpl.net/)
author: aeroson
advise: ChessMax
editor: frekons
*/
#if UNITY_EDITOR
@mukaschultze
mukaschultze / PreviewBackgroundColor.cs
Last active May 6, 2020 22:09
Change Unity preview background to a nicer color!
using UnityEditor;
using UnityEngine;
namespace EnhancedHierarchy {
[InitializeOnLoad]
static class PreviewBackgroundColor {
private static readonly Color backgroundColor = new Color(1f, 0f, 1f); // Change this color
static PreviewBackgroundColor() {