Skip to content

Instantly share code, notes, and snippets.

/** The function should be invoke when the thread exit. The execution only continues if all child threads have invoked their `JoinFunction`. */
typedef JoinFunction = (Void->Void)->Void;
/**
Fork threads for every element in <code>threadIdentifiers</code>.
@param handler The callback function invoked for each element in <code>threadIdentifiers</code>.
The <code>handler</code> can receive two parameters:
the element in <code>threadIdentifiers</code> and the <code>JoinFunction</code>.
**/
public static function fork<Identifier>(
ModelEntity.init = function(completion) {
var componentError = null;
var postFork = function() {
if ( componentError != null ) Log.error(componentError);
completion(componentError);
}
ForkJoin.fork(entity.m_components,function(component,join) {
component.onInit(function(error) {
if(error != null) componentError = error;
com.dongxiguo.continuation.utils.ForkJoin.fork = function(threadIdentifiers,handler) {
if(Lambda.empty(threadIdentifiers)) throw "threadIdentifiers must not be empty!";
var counter = 1;
var quickJoinHandler = null;
var $it0 = $iterator(threadIdentifiers)();
while( $it0.hasNext() ) {
var id = $it0.next();
counter++;
var isJoined = [false];
handler(id,(function(isJoined) {
# This file determines which asset bundles will be created for the game.
#
# Bundles are first created by specifying rules and paths. There are 5 available rules:
# bundle_all: Create a SINGLE asset bundle for all files found in the specified paths. This operates recursively on directories.
# bundle_each_file: Create an asset bundle for EACH file found in the specified paths. This operates recursively on directories.
# bundle_each_folder: Create an asset bundle for EACH subfolder found in the specified paths.
# bundle_all_folders: Create a SINGLE asset bundle for all subfolders found in the specified paths.
# exclude_all: Exclude all specified files/folders from being bundled by rules specified after this rule.
# exclude_folders: Exclude files in subfolders of the specified folders from being being bundled by rules specified after this rule.
#
Shader "Hidden/FastBlur" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Bloom ("Bloom (RGB)", 2D) = "black" {}
}
CGINCLUDE
#include "UnityCG.cginc"
#pragma strict
@script ExecuteInEditMode
@script RequireComponent (Camera)
@script AddComponentMenu ("Image Effects/Blur/Blur (Optimized)")
class Blur extends PostEffectsBase {
@Range(0, 2)
using haxe.root;
#pragma warning disable 109, 114, 219, 429, 168, 162
namespace view{
public class PzBlur : Blur, haxe.lang.IHxObject {
public PzBlur(haxe.lang.EmptyObject empty) : base(){
unchecked {
}
}
@dogles
dogles / Preprocessor.hx
Created November 17, 2014 15:49
Unity Ifdefs
package hugs;
import haxe.macro.Expr;
import haxe.macro.Context;
/** Utility to generate C# preprocessor macros */
class Preprocessor
{
public macro static function IF(name:ExprOf<String>) : Expr {
var ns = switch(name.expr) {
@dogles
dogles / UIPanel.diff
Created December 17, 2014 14:38
UIPanel.cs change
--- UIPanel-old.cs 2014-12-17 09:36:13.000000000 -0500
+++ UIPanel-new.cs 2014-12-12 13:10:36.000000000 -0500
@@ -1157,19 +1157,19 @@
{
p.startingRenderQueue = rq;
p.UpdateDrawCalls();
- rq += p.drawCalls.size;
+ rq += p.drawCalls.size*2;
}
else if (p.renderQueue == RenderQueue.StartAt)
@dogles
dogles / gist:507a3be60f47a76616ec
Created December 18, 2014 21:03
Fucking FTUE
if ( !m_allUnitsPlaced ){
if ( m_combatGameMode.hud.unitBeingDragged == null && !m_combatGameMode.hordeSpawned ) {
m_combatGameMode.hud.hideSkillSlots();
m_combatGameMode.hud.showSlot(0, false);
m_combatGameMode.hud.showSlot(1, false);
m_combatGameMode.hud.showSlot(2, false);
m_combatGameMode.hud.showSlot(3, false);
m_combatGameMode.hud.setActiveTopHUD(false);
m_combatGameMode.hud.showSlotArrows(true);
NGUITools.SetActive(m_combatGameMode.hud.gameObject, true);