Skip to content

Instantly share code, notes, and snippets.

@pencilking2002
pencilking2002 / ScriptableObjectWindow.cs
Created May 21, 2019 19:43
View and edit all your Scriptable Objects in a single Editor Window
using UnityEngine;
using UnityEditor;
using Object = UnityEngine.Object;
using System;
// DESCRIPTION
// This is a Unity editor script that allows you to view and edit all your Scriptable Objects in one Editor Window
// INSTRUCTIONS
// In Unity, place this file in an Editor folder.
Shader "Custom/DynamicWater"
{
Properties
{
_Tint("Tint", Color) = (1, 1, 1, .5)
_MainTex("Main Texture", 2D) = "white" {}
_HighlightTex ("Highlight Tex", 2D) = "black" {}
_NoiseTex("Extra Wave Noise", 2D) = "white" {}
_FoamColor("Foam Color", Color) = (1,1,1,1)
@pencilking2002
pencilking2002 / CamFeed.shader
Created April 30, 2020 19:40
Shader used in the Sleepwatchers game to display and distort a web cam feed
Shader "Unlit/CameraFeedShader"
{
Properties
{
_MainTex ("Main Texture", 2D) = "white" {}
_TintColor ("Tint Color", Color) = (1,1,1,1)
_SecondaryTex ("Secondary Texture", 2D) = "black" {}
_ScrollSpeed ("Scroll Speed", Float) = 8.0
_NoiseTex ("Noise", 2D) = "white" {}
_NoiseScrollSpeed("Noise Scroll Speed", Float) = 8.0
@pencilking2002
pencilking2002 / .cs
Last active December 12, 2020 21:17
For loop with delay
public int[] myArr = new int[3];
public float delay = 5.0f;
private float lastDebugTime;
private int currIndex;
// For keeping track of the index in a foreach loop
private float foreachIndex;
private void Update()
{