This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gistPrefix = 'http://gist.github.com/', | |
cachedWrite = document.write, | |
body = $('body'), | |
gists = $('p.gist').map(function(n, p) { | |
p = $(p); | |
var a = $('a', p), | |
href = a.attr('href'); | |
if (a.length && href.indexOf(gistPrefix) == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update() { | |
if ( Vector3.Distance( enemy.position, transform.position ) < 10 ) | |
print("I sense the enemy is near!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Category: This is a free-form string used to categorise your events. | |
// Action: Another free-form string which represents the type of event, ex. “killed” and “game_start”. | |
// Label: This is an optional string parameter to the action. | |
// Value: This is an optional fractional number parameter to the action. | |
Application.ExternalCall("pageTracker._trackEvent", new object[] { category, action, label, value} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public enum GameStatus | |
{ | |
Setup, | |
Initializing, | |
ReInitializing, | |
AwaitingMasterServer, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public enum GameStatus | |
{ | |
Setup, | |
Initializing, | |
ReInitializing, | |
AwaitingMasterServer, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections.Generic; | |
public class MyStateMachine : MonoBehaviour | |
{ | |
public delegate void StateHandlerDelegate (); | |
public enum MyStateType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cgi | |
from google.appengine.api import mail | |
from google.appengine.ext import deferred | |
from ndb import model | |
from tipfy.routing import url_for | |
from tipfyext.ndb.mixins import DateMixin | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alex@rozgo.com | |
using UnityEngine; | |
using System.Collections; | |
public class Gestures : MonoBehaviour { | |
float lastf0f1Dist; | |
void Update () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User(db.Model): | |
location = db.StringProperty() | |
timezone = db.StringProperty(default='America/Los_Angeles') | |
# Do this once per user | |
def calculate_timezone(self): | |
from simplegeo import Client | |
client = Client('oauth key', 'oauth secret SHH') | |
response = client.context.get_context_by_address(self.location) | |
for feature in response['features']: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnGUI() { | |
var screenScale: float = Screen.width / 480.0; | |
var scaledMatrix: Matrix4x4 = Matrix4x4.identity.Scale(Vector3(screenScale,screenScale,screenScale)); | |
GUI.matrix = scaledMatrix; | |
// then do the rest of your GUI as per normal, using the 480x320 screen size you had for your standard res iPhone app | |
} |
OlderNewer