Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class Creator : MonoBehaviour {
// Use this for initialization
void Start () {
for (int h = 0; h < 10; h++)
{
float he = (float)h*0.1f;
@pandr
pandr / FlyCamSmooth
Created March 10, 2015 23:27
Very smooth unity cam
using UnityEngine;
using System.Collections;
/*
* Based on http://www.blenderfreak.com/blog/post/flythrough-camera-smooth-movement-unity3d/
*
* Controls:
* WASD + R/F for Up/Down
* Mouse wheel control movement speed
* Mouse pointer is used for joystick like control of orientation
@pandr
pandr / strenge.js
Last active October 22, 2015 06:30
JavaScript Strenge
var fornavn = "Hans";
var efternavn = "Jensen";
var navn = fornavn + " " + efternavn; // "Hans Jensen"
var tom_streng = "";
var historie = "Der gik en hest";
var laengde = historie.length; // antal bogstaver i historien
var fundet = historie.indexOf("var");
var e = historie.charAt(1); // "e"
// Simple fps controller for unity
// To use, build this:
//
// Capsule
// Camera
//
// Put this script AND a CharacterController on the Capsule
// Link up camera to the "player_cam" property of this script
// Make sure Camera is positioned at (locally) 0, 0, 0 and with no rotation and scale
@pandr
pandr / FeetIK.cs
Created March 10, 2017 22:15
Snip about feet IK for Unity
// somewhere in your charactercontroller
public bool m_UseFeetIK = true;
public float m_FeetIkOffset = 0.0f;
void OnAnimatorIK()
{
if (m_Animator)
{
if (m_IsGrounded && m_UseFeetIK)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
interface IBitStreamWriter
{
void SeekZero();
function setup() {
createCanvas(400, 400);
}
var pilop = 38;
var pilned = 40;
var pilhøjre = 39;
var pilvenstre = 37;
var x = 2;
var y = 2;
var blob = [];
function setup()
{
createCanvas(800, 400);
background(128);
fill(100,12,12);
noStroke(); }
function draw() { if(mouseIsPressed)
function setup()
{
createCanvas(700, 400);
background(255);
}
var deg60 = Math.PI/3;
function addVector(x,y,angle,length)
{
function setup()
{
createCanvas(700, 500);
background(220);
strokeWeight(10);
}
function transform(shape, angle, factor)
{
shape.x += shape.size * Math.cos(shape.angle);