Skip to content

Instantly share code, notes, and snippets.

@mikelovesrobots
mikelovesrobots / gist:f8aeb8cc5ccb1b97bc61
Created April 17, 2015 18:42
ParseSafeInitializeBehaviour
using UnityEngine;
using System.Collections;
using Parse;
// Parse for Unity3d stops responding if it gets initialized twice
// or the original initialization goes away (e.g., you leave the scene)
// so use this instead of the regular ParseInitializeBehaviour, and
// throw it in every scene that you need to talk to Parse in
public class ParseSafeInitializeBehaviour : ParseInitializeBehaviour {
@mikelovesrobots
mikelovesrobots / gist:274b40c23d64a09d58c3
Created April 17, 2015 18:41
ParseSafeInitializeBehaviour
using UnityEngine;
using System.Collections;
using Parse;
// Parse stops responding if it gets initialized twice or the original initialization goes away (e.g., you leave the scene)
// so use this instead of the regular ParseInitializeBehaviour, and throw it in every scene that you access Parse from
public class ParseSafeInitializeBehaviour : ParseInitializeBehaviour {
public static bool IsAlreadyAlive;
@mikelovesrobots
mikelovesrobots / gist:60830f18c3422a517b3e
Created April 10, 2015 20:01
Dungeon Highway Level Layout "Miniboss and Friends"
|
|
|
CC |
|
|
CC |
|
|
CC |
@mikelovesrobots
mikelovesrobots / gist:42cfc1938f72a1d44591
Created April 8, 2015 23:13
Dungeon Highway Adventures - Speed Dungeon - Very Hard Level
r
OXO
[N]
$P$
$P$
$$$
$
fff
222
eEe
@mikelovesrobots
mikelovesrobots / gist:e526809506a17b4db65b
Created March 3, 2015 21:15
Bulk Material Creator for Unity3d. Just select your textures, then select from the menu Assets > Bulk Material Creator, assign a shader and hit create. MIT License.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class BulkMaterialCreator : ScriptableWizard
{
public Shader Shader;
@mikelovesrobots
mikelovesrobots / Character.cs
Created March 28, 2014 00:13
Dungeon Highway Character Model
using UnityEngine;
using System.Collections;
[System.Serializable]
public class Character {
public CharacterType CharacterType;
public Sprite DefaultSprite;
public string PortraitSpriteName;
public string WalkAnimationName {
@mikelovesrobots
mikelovesrobots / AccelerometerAdapter.cs
Last active August 29, 2015 13:57
Adapter for Unity that uses the mouse for input if the current device (e.g., the editor) doesn't support acceleration. MIT license, so go nuts.
using UnityEngine;
using System.Collections;
public class AccelerometerAdapter : MonoBehaviour {
public const float TILT_SENSITIVITY = 1.5f;
public Vector3 Input {
get {
if (SystemInfo.supportsAccelerometer) {
return UnityEngine.Input.acceleration * TILT_SENSITIVITY;
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public class DudeDeathController : MonoBehaviour {
...
public void Die() {
DudeMotionArrester.SlowToStop();
Animator.Play("DudeDie");
@mikelovesrobots
mikelovesrobots / unlit-transparent-flash-fx.shader
Created January 25, 2014 05:24
Unlit/transparent shader that can flash the textures white (pure black is all original texture, white is all white)
Shader "Unlit/TransparentFlashFX" {
Properties {
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
}
Category {
Lighting On
ZWrite Off
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
@mikelovesrobots
mikelovesrobots / gist:5811851
Created June 19, 2013 05:23
Just because Apple/Objective-C wants you to put everything in one goddamn file doesn't mean you actually have to have it all in one file.
//
// MapViewController.m
// placesihavepooped
//
// Created by Michael Judge on 6/16/13.
// Copyright (c) 2013 Michael Judge. All rights reserved.
//
#import "MapViewController.h"