This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Milkbag/CurvatureImageEffect" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_LightStrength ("LightStrength", Float) = 0.3 | |
_DarkStrength ("DarkStrength", Float) = 0.3 | |
_Spread ("Spread", Float) = 1.0 | |
[Toggle(USE_MULTIPLY)] _UseMultiply("Use Multiply", Float) = 0 | |
[Toggle(CURVATURE_ONLY)] _CurvatureOnly("Curvature Only", Float) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cellular noise ("Worley noise") in 2D in GLSL. | |
// Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved. | |
// This code is released under the conditions of the MIT license. | |
// See LICENSE file for details. | |
// https://github.com/stegu/webgl-noise | |
// Modulo 289 without a division (only multiplications) | |
float3 mod289(float3 x) { | |
return x - floor(x * (1.0 / 289.0)) * 289.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine.UI; | |
[RequireComponent(typeof(CanvasRenderer))] | |
public class BezierLineRenderer : Graphic | |
{ | |
public Texture texture; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.Linq; | |
using System.IO; | |
public class EditorUtils | |
{ | |
[MenuItem("CONTEXT/ScriptableObject/Sync")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="main"></div> | |
<br/> | |
<button id="clear">Clear</button> | |
<button id="fill">Fill</button> | |
<button id="load">Load</button> | |
<br/> | |
<br/> | |
<textarea id="output"></textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <OPL2.h> | |
#include <midi_instruments.h> | |
OPL2 opl2; | |
float tempo = 80; | |
const int numParts = 3; | |
int bassNotes[] = {32,36,37,34}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System; | |
//based on the code in this post: http://martinecker.com/martincodes/unity-editor-window-zooming/ | |
//but I changed how the API works and made it much more flexible | |
//usage: create an EditorZoomer instance wherever you want to use it (it tracks the pan + zoom state) | |
//in your OnGUI, draw your scrollable content between zoomer.Begin() and zoomer.End(); | |
//you also must offset your content by zoomer.GetContentOffset(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
// Helper Rect extension methods | |
public static class RectExtensions | |
{ | |
public static Vector2 TopLeft(this Rect rect) | |
{ | |
return new Vector2(rect.xMin, rect.yMin); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class BackwardEulerController : MonoBehaviour | |
{ | |
public float gain = 200; //200-700; | |
public float damp = 20; //20-100; | |
public Transform target = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Text; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
using System.Linq; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Callbacks; |