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
# constants | |
COMPILER = "g++" | |
EXEC = "hello" | |
FLAGS = "-Wall -Wextra" | |
OBJECTS = ['hello.o', 'add.o'] | |
file 'hello' => OBJECTS | |
# tasks |
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
// float->sRGB8 conversions - two variants. | |
// by Fabian "ryg" Giesen | |
// | |
// I hereby place this code in the public domain. | |
// | |
// Both variants come with absolute error bounds and a reversibility and monotonicity | |
// guarantee (see test driver code below). They should pass D3D10 conformance testing | |
// (not that you can verify this, but still). They are verified against a clean reference | |
// implementation provided below, and the test driver checks all floats exhaustively. | |
// |
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; | |
/* | |
Runtime use: | |
To be available, AirPlay needs to be switched on for the device either via a native AirPlay UI component or | |
via the global AirPlay mirroring setting. Your options are: | |
A: Modify your Xcode project to layer a native AirPlay Cocoa control somewhere over your Unity content. |
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
<?php | |
// (string) $message - message to be passed to Slack | |
// (string) $room - room in which to write the message, too | |
// (string) $icon - You can set up custom emoji icons to use with each message | |
public static function slack($message, $room = "engineering", $icon = ":longbox:") { | |
$room = ($room) ? $room : "engineering"; | |
$data = "payload=" . json_encode(array( | |
"channel" => "#{$room}", | |
"text" => $message, |
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
/* | |
Tween for Unity by Alec Holowka | |
http://InfiniteAmmo.com - @infinite_ammo | |
*/ | |
using UnityEngine; | |
using System.Collections; | |
public class TweenBase : MonoBehaviour | |
{ |
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
/* | |
* This code is provided as is without warranty, guarantee of function, | |
* or provided support | |
*/ | |
using System.Collections; | |
using UnityEngine.Events; | |
namespace UnityEngine.UI.CoroutineTween | |
{ |
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
//#define DEBUG_THREADING | |
using UnityEngine; | |
using System.Collections; | |
using System.Threading; | |
using System.Reflection; | |
public delegate IEnumerator MonitorCoroutine<T> (CoroutineData<T> data); |
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
/** | |
* This software is in the public domain. Where that dedication is not recognized, | |
* you are granted a perpetual, irrevokable license to copy and modify this file | |
* as you see fit. | |
* | |
* Requires SDL 2.0.4. | |
* Devices that do not support Metal are not handled currently. | |
**/ | |
#import <UIKit/UIKit.h> |
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
public void ForcedFullGarbageCollection() { | |
var size = GC.GetTotalMemory(false); | |
for (var i = 0; i < 100; ++i) { | |
GC.Collect(); | |
GC.WaitForFullGCComplete(); | |
GC.WaitForPendingFinalizers(); | |
var newSize = GC.GetTotalMemory(false); | |
var delta = (size - newSize) / (double)size; | |
if (delta < 0.01) | |
break; |
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
private static Vector2 WorldToPixelCoords(Vector3 projectedPoint, Sprite sprite, Transform transform) | |
{ | |
var textureRect = sprite.textureRect; | |
var spriteBounds = sprite.bounds; | |
var localPoint = transform.InverseTransformPoint(projectedPoint); | |
localPoint.x = (localPoint.x - spriteBounds.min.x) / (spriteBounds.size.x); | |
localPoint.y = (localPoint.y - spriteBounds.min.y) / (spriteBounds.size.y); |
OlderNewer