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; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class DudeDeathController : MonoBehaviour { | |
... | |
public void Die() { | |
DudeMotionArrester.SlowToStop(); | |
Animator.Play("DudeDie"); |
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 class AccelerometerAdapter : MonoBehaviour { | |
public const float TILT_SENSITIVITY = 1.5f; | |
public Vector3 Input { | |
get { | |
if (SystemInfo.supportsAccelerometer) { | |
return UnityEngine.Input.acceleration * TILT_SENSITIVITY; |
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; | |
[System.Serializable] | |
public class Character { | |
public CharacterType CharacterType; | |
public Sprite DefaultSprite; | |
public string PortraitSpriteName; | |
public string WalkAnimationName { |
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
r | |
OXO | |
[N] | |
$P$ | |
$P$ | |
$$$ | |
$ | |
fff | |
222 | |
eEe |
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
| | |
| | |
| | |
CC | | |
| | |
| | |
CC | | |
| | |
| | |
CC | |
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; | |
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; |
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
named_scope :sort_string, lambda do |type| | |
order_string = case type | |
when 'score' | |
"score desc" | |
when 'date' | |
"created_at desc" | |
else | |
raise "Unknown type passed into sort_string: #{type.inspect}" | |
end |
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
// the node OOP-way | |
function Awake () { | |
var networkConnector = NetworkConnector(isHost()); | |
networkConnector.connect(function() { | |
spawnPlayer(); | |
}); | |
} | |
// the unity3d-ish way |
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
jasmine.PrettyPrinter.prototype.iterateObject = (obj, fn) -> | |
for own property, _ of obj | |
if property == '__Jasmine_been_here_before__' | |
continue | |
fn(property, if obj.__lookupGetter__ then (obj.__lookupGetter__(property) != jasmine.undefined && obj.__lookupGetter__(property) != null) else false) | |
jasmine.StringPrettyPrinter::originalEmitObject = jasmine.StringPrettyPrinter::emitObject | |
jasmine.StringPrettyPrinter::emitObject = (obj) -> | |
if obj instanceof jQuery |
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; | |
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 { |
OlderNewer