Skip to content

Instantly share code, notes, and snippets.

@gkaizer1
gkaizer1 / ripple.shader
Last active December 31, 2023 00:51
Unity example of ripple effect
Shader "Unlit/ripple_shader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_amount ("_amount", Range(0.01, 1.0)) = 0.5
_spread ("_spread", Range(0.01, 1.0)) = 0.5
_width ("_width", Range(0.01, 1.0)) = 0.5
_alpha ("_alpha", Range(0.01, 1.0)) = 0.5
@yasirkula
yasirkula / BoxColliderWizard.cs
Last active April 15, 2024 08:37
Creating & editing BoxColliders intuitively in Unity
#if UNITY_EDITOR
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine.Rendering;
#endif
using UnityEngine;
public class BoxColliderWizard : MonoBehaviour
@Invertex
Invertex / CustomHoldingInteraction.cs
Last active February 1, 2024 16:00
Unity New Input System custom Hold "Interaction" where the .performed callback is constantly triggered while input is held.
using UnityEngine;
using UnityEngine.InputSystem;
//!!>> This script should NOT be placed in an "Editor" folder. Ideally placed in a "Plugins" folder.
namespace Invertex.UnityInputExtensions.Interactions
{
//https://gist.github.com/Invertex
/// <summary>
/// Custom Hold interaction for New Input System.
/// With this, the .performed callback will be called everytime the Input System updates.
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active April 2, 2024 18:56
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@ProGM
ProGM / ExampleBehavior.cs
Created October 19, 2016 10:39
A PropertyDrawer to show a popup field with a generic list of string for your Unity3d attribute
public class MyBehavior : MonoBehaviour {
// This will store the string value
[StringInList("Cat", "Dog")] public string Animal;
// This will store the index of the array value
[StringInList("John", "Jack", "Jim")] public int PersonID;
// Showing a list of loaded scenes
[StringInList(typeof(PropertyDrawersHelper), "AllSceneNames")] public string SceneName;
}