Skip to content

Instantly share code, notes, and snippets.

@Manamongods
Manamongods / GizmosContextMenu.cs
Last active January 21, 2022 13:59
(For 2022.1) In new Unity versions, collapsing a component doesn't hide its gizmos anymore, which makes it slower to temporarily hide a component's gizmos. This helps that out by adding options to the right click, the context menu, of a component
// Creative Commons 0
#define SINGLE_BUTTON // Comment this if you want individual buttons
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
@Manamongods
Manamongods / MeshRendererSortingEditor.cs
Last active November 17, 2022 22:36 — forked from pavel-fadrhonc/MeshRendererSortingEditor.cs
Expose sorting layer in MeshRenderer inspector, for rendering on top of sprites
using System;
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.Reflection;
/// This just exposes the Sorting Layer / Order in MeshRenderer since it's there
/// but not displayed in the inspector. Getting MeshRenderer to render in front
/// of a SpriteRenderer is pretty hard without this.
/// Adapted from https://gist.github.com/sinbad/bd0c49bc462289fa1a018ffd70d806e3
@Manamongods
Manamongods / bloom.fsh
Last active June 7, 2021 16:44
Fixes for the bloom in Cinematica (by felixjones) for Minecraft
#version 110
#define COLOR_EXPONENT 0.9 //This makes colors brighter and more saturated. "1.0" would be default
#define SIZE 40.0
#define THRESHOLD 0.8 //Anything brighter than this creates bloom
#define EXPONENT 2.5 //The power raised on the brightness above the threshold
#define INTENSITY 1.0 //How bright the bloom is
//Steffen Vetne made this
//Creative Commons 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class Swayer : MonoBehaviour
{
//Steffen Vetne made this
//Creative Commons 0
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
[ExecuteInEditMode]
[RequireComponent(typeof(ParticleSystem))]
public class EditorParticles : MonoBehaviour
//Steffen Vetne made this
//Creative Commons 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NonLoopingParticles : MonoBehaviour
{
#if UNITY_EDITOR
//Steffen Vetne made this
//Creative Commons 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class RandomSpinner : MonoBehaviour
{
//Steffen Vetne made this
//Creative Commons 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class Spinner : MonoBehaviour
{
//Steffen Vetne made this
//Creative Commons 0
using UnityEngine;
[ExecuteInEditMode]
public class Bobber : MonoBehaviour
{
//Fields
public Vector3 localPosition;