This file contains hidden or 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; | |
[RequireComponent(typeof(Camera))] | |
public class FlyCamera : MonoBehaviour { | |
public float acceleration = 50; // how fast you accelerate | |
public float accSprintMultiplier = 4; // how much faster you go when "sprinting" | |
public float lookSensitivity = 1; // mouse look sensitivity | |
public float dampingCoefficient = 5; // how quickly you break to a halt after you stop your input | |
public bool focusOnEnable = true; // whether or not to focus and lock cursor immediately on enable |
This file contains hidden or 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
#include <stdlib.h> | |
int foo(bool x) { | |
return x ? ({ b: goto a; 1; }) : ({ a: goto b; 2; }); | |
} |
This file contains hidden or 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
// Type your code here, or load an example. | |
void copy(short* to, short* from, int count) { | |
auto n = (count + 7) / 8; | |
switch (count % 8) { | |
case 0: do { *to++ = *from++; | |
case 7: *to++ = *from++; | |
case 6: *to++ = *from++; | |
case 5: *to++ = *from++; | |
case 4: *to++ = *from++; | |
case 3: *to++ = *from++; |
This file contains hidden or 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
Rect lastRect = GUILayoutUtility.GetLastRect(); | |
if (Event.current.type == EventType.Repaint) | |
{ | |
if (game == null) | |
{ | |
game = new Game(); | |
game.Restart(lastRect); | |
} | |
game.Update(); | |
} |
This file contains hidden or 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace GitHub.Unity { | |
public class Game | |
{ | |
private Texture2D texture1 = Utility.GetTextureFromColor(Color.blue); | |
private Texture2D paddleTexture; | |
private float wallThickness = 2f; |
This file contains hidden or 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
const [data, err] = await new Promise((resolve, reject) => | |
doSomething(resolve, reject) | |
) | |
.then(data => [data, undefined]) | |
.catch(e => [undefined, e]); |
This file contains hidden or 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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
[InitializeOnLoad] | |
[Location("our_cache.txt", LocationAttribute.Location.LibraryFolder)] | |
public class FirstRun : ScriptObjectSingleton<FirstRun> | |
{ |
This file contains hidden or 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
/* | |
* MIT License | |
Copyright (c) 2016-2018 GitHub | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
2018-02-14T20:34:38.931150+00:00 app[web.1]: } | |
2018-02-14T20:34:38.931232+00:00 app[web.1]: 2018/02/14 20:34:38 "POST /move HTTP/1.1 200 0" 0.000878 | |
2018-02-14T20:34:38.931151+00:00 app[web.1]: } | |
2018-02-14T20:35:04.717266+00:00 heroku[router]: at=info method=GET path="/" host=test-snake-1234.herokuapp.com request_id=d0304742-a70f-4323-9859-2a4f02d3fbfc fwd="193.106.166.58" dyno=web.1 connect=1ms service=2ms status=200 bytes=226 protocol=http | |
2018-02-14T20:35:04.716332+00:00 app[web.1]: 2018/02/14 20:35:04 "GET / HTTP/1.1 200 0" 0.000191 | |
2018-02-14T20:35:05.055547+00:00 app[web.1]: 2018/02/14 20:35:05 "GET /favicon.ico HTTP/1.1 404 0" 0.000053 | |
2018-02-14T20:35:05.056303+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=test-snake-1234.herokuapp.com request_id=ddfc568f-37ed-46bc-88c4-66353faeaaa2 fwd="193.106.166.58" dyno=web.1 connect=1ms service=1ms status=404 bytes=195 protocol=http | |
2018-02-14T20:35:34.989408+00:00 heroku[router]: at=info method=GET path="/" host=test-snake-1234.herokuapp. |
This file contains hidden or 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
2018-02-14T19:19:21.776159+00:00 app[web.1]: 2018/02/14 19:19:21 routes.go:30: MOVE REQUEST | |
2018-02-14T19:19:21.777625+00:00 app[web.1]: 2018/02/14 19:19:21 routes.go:35: Bad move request: json: cannot unmarshal string into Go struct field MoveRequest.id of type int | |
2018-02-14T19:19:21.777684+00:00 app[web.1]: 2018/02/14 19:19:21 helpers.go:20: { | |
2018-02-14T19:19:21.777686+00:00 app[web.1]: "food": [], | |
2018-02-14T19:19:21.777687+00:00 app[web.1]: "height": 2, | |
2018-02-14T19:19:21.777688+00:00 app[web.1]: "id": 0, | |
2018-02-14T19:19:21.777690+00:00 app[web.1]: "snakes": [ | |
2018-02-14T19:19:21.777691+00:00 app[web.1]: { | |
2018-02-14T19:19:21.777692+00:00 app[web.1]: "body": [ | |
2018-02-14T19:19:21.777693+00:00 app[web.1]: { |