Skip to content

Instantly share code, notes, and snippets.

View hergaiety's full-sized avatar
🐶
Arf?

Ava Gaiety Wroten hergaiety

🐶
Arf?
View GitHub Profile
@ftvs
ftvs / CameraShake.cs
Last active May 8, 2024 20:34
Simple camera shake effect for Unity3d, written in C#. Attach to your camera GameObject. To shake the camera, set shakeDuration to the number of seconds it should shake for. It will start shaking if it is enabled.
using UnityEngine;
using System.Collections;
public class CameraShake : MonoBehaviour
{
// Transform of the camera to shake. Grabs the gameObject's transform
// if null.
public Transform camTransform;
// How long the object should shake for.
@mrcoles
mrcoles / detect-autoplay.js
Created May 8, 2013 01:25
A script to detect browser support for the autoplay attribute on the HTML5 Audio element.
// Detect autoplay
// ---------------
// This script detects whether the current browser supports the
// autoplay feature for HTML5 Audio elements, and it sets the
// `AUTOPLAY` variable accordingly.
// Used in the Meteor app [PicDinner](http://picdinner.com)