Skip to content

Instantly share code, notes, and snippets.

@JoseMiguelPizarro
JoseMiguelPizarro / PreviewData.cs
Created April 6, 2021 15:17
Rendering preview window in Unity
using UnityEngine;
[CreateAssetMenu(menuName ="Data/PreviewData")]
public class PreviewData : ScriptableObject
{
public Color previewColor;
}
@robotron2084
robotron2084 / SerializedPropertyViewer.cs
Created March 29, 2016 17:00
Serialized Property Viewer
using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections;
using System.Collections.Generic;
public class SerializedPropertyViewer : EditorWindow
{
public class SPData
using UnityEngine;
public class MeshBlit : MonoBehaviour
{
public RenderTexture rt;
public Mesh mesh;
public Material material;
public Vector3 meshPosition = new Vector3(0.5f, 0.5f, -1);
@aras-p
aras-p / Projector Light.shader
Last active October 3, 2023 12:11
Projector shaders without fixed function
Shader "Projector/Light" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" {}
_FalloffTex ("FallOff", 2D) = "" {}
}
Subshader {
Pass {
ZWrite Off
@ZimM-LostPolygon
ZimM-LostPolygon / UnityGuidRegenerator.cs
Last active February 8, 2024 10:10
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
Shader "Pristine Grid"
{
Properties
{
[KeywordEnum(MeshUV, WorldX, WorldY, WorldZ)] _UVMode ("UV Mode", Float) = 2.0
_GridScale ("Grid Scale", Float) = 1.0
_LineWidthX ("Line Width X", Range(0,1.0)) = 0.01
_LineWidthY ("Line Width Y", Range(0,1.0)) = 0.01
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@digitalshadow
digitalshadow / OpenSimplexNoise.cs
Last active May 1, 2024 04:32
OpenSimplex Noise Refactored for C#
/* OpenSimplex Noise in C#
* Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19
* and heavily refactored to improve performance. */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace NoiseTest