Skip to content

Instantly share code, notes, and snippets.

View eddietree's full-sized avatar

Eddie Lee eddietree

View GitHub Profile
@eddietree
eddietree / hookdata-5.json
Created March 10, 2017 07:07
hook data, 4-levels (chords), 5 chords per-level, total 156 chord progressions
{
"1": {
"probability": 0.2373158756137479,
"name": "I",
"next": {
"2": {
"probability": 0.09345794392523363,
"name": "ii",
"next": {
"1": {
@eddietree
eddietree / hookdata-6.json
Last active March 10, 2017 06:58
hook data, 4-levels (chords), 6 chords per-level, total 259 chord progressions
{
"1": {
"probability": 0.22480620155038752,
"name": "I",
"next": {
"2": {
"probability": 0.08823529411764704,
"name": "ii",
"next": {
"1": {
var material = new THREE.MeshBasicMaterial({
color: 0xff0000,
shading: THREE.SmoothShading,
transparent: true,
blending: THREE.CustomBlending,
blendEquation: THREE.MaxEquation,
});
material.needsUpdate = true;
material = new THREE.MeshBasicMaterial({
color: 0xff0000,
shading: THREE.SmoothShading,
transparent: true,
blending: THREE.CustomBlending,
blendEquation: THREE.MaxEquation,
});
material.needsUpdate = true;
public override Vector3 GetThrowVelocity()
{
var device = GetDevice();
// basically to calc throw velocity:
// 1) set phantom volume to controller pos
// 2) set its velocity calc the velocity point of throwing
var rb = throwVolume;
rb.transform.position = transform.position;
v2f vert (appdata v)
{
v2f o;
v.vertex.x = frac(v.vertex.x + frac(_Time.y * .1));
//v.vertex.x = frac(v.vertex.x);
float cSize = _MainTex_TexelSize.z;
float4 cCd = float4(v.vertex.x, 0, 0, 0);
//cCd.x = floor(cCd.x * cSize) / cSize;
using UnityEngine;
using System.Collections;
public struct AudioPlayerParams
{
public float minDistance;
public float maxDistance;
public float volume;
public bool dopplerEnabled;
public bool autoPlay; // auto play when it starts?
using UnityEngine;
using System.Collections;
public class #SCRIPTNAME# : MonoBehaviour
{
void Start ()
{
}
@eddietree
eddietree / CoroutineUseCase.cs
Last active January 29, 2016 18:07
for isaac
// Problem: you are making an AI that goes to a location, stops for 1 second, then starts again
IEnumerator DoCoroutine() {
// go to a location
Vector3 randomDestination = GetRandomLocation();
float walkTotalTime = 1.0;
// walk towards
// input that you pass in, however unity does it
uniform vec2 uvTouchPos;
uniform float circleRadius;
// the fragment shader basically tells the GPU what to color that exact pixel on screen
// the UV is what texture coordinate you are looking at
vec4 FragColor( vec2 uv )
{
// find out how far you are from touch
float distanceToTouch = length( uv - uvTouchPos );