(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
var metas = document.getElementsByTagName('meta'); | |
var i; | |
if (navigator.userAgent.match(/iPhone/i)) { | |
for (i=0; i<metas.length; i++) { | |
if (metas[i].name == "viewport") { | |
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
} | |
} |
// Drop this script in the Editor directory in your project (creating the Editor directory if it's not there yet) | |
// Then re-import the assets in the directories covered by this script (right click and reimport) | |
// | |
// I would replace my path checking with the path checking from this gist: | |
// https://gist.github.com/1842177 | |
// | |
// The texture settings for icons might want to use some of his settings combined with mine as well | |
using UnityEngine; |
using UnityEngine; | |
/** | |
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices. | |
*/ | |
public class PixelPerfectCam : MonoBehaviour { | |
/** | |
* The target size of the view port. | |
*/ | |
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f); | |
/** |
using UnityEngine; | |
using System.Collections; | |
using System.Security.Cryptography; | |
using System; | |
using System.Text; | |
public class StackMob : MonoBehaviour | |
{ | |
public const string acceptHeader = "application/vnd.stackmob+json; version=0"; // 0 = development, 1 = production | |
public const string apiKey = "e78a2646-d479-47b1-9ae5-65732c5eabdc"; // nixApp |
# -*- coding: utf-8 -*- | |
# java.py - sublimelint package for checking java files | |
import sublime | |
import subprocess | |
import os | |
import os.path | |
import re | |
from base_linter import BaseLinter, INPUT_METHOD_FILE |
#pragma strict | |
/*********************************************************************** | |
* Notes | |
***********************************************************************/ | |
/* | |
* This is a boilerplate controller for a 2D or 2.5D platform game. | |
* To that end, this controller allows for movement along the X and Y | |
* axes only. There is built-in support for jumping, double jumping, |
/* | |
* This code is provided as is without warranty, guarantee of function, | |
* or provided support | |
*/ | |
using System.Collections; | |
using UnityEngine.Events; | |
namespace UnityEngine.UI.CoroutineTween | |
{ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/bash | |
# @link https://gist.github.com/mattscilipoti/8424018 | |
# | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... |
using System.Collections.Generic; | |
using System.Text; | |
namespace UnityEngine.EventSystems | |
{ | |
public abstract class PointerInputModule : BaseInputModule | |
{ | |
public const int kMouseId = -1; | |
public const int kFakeTouchesId = -2; |