Skip to content

Instantly share code, notes, and snippets.

gamemachine / gist:51c4af5cd0a3e1f8fd56
Created Jul 26, 2014
Unity Scene exporter for navigation meshes
View gist:51c4af5cd0a3e1f8fd56
Based on EditorObjExporter.cs and TerrainObjExporter. Exports the current terrain plus selected objects to a single wavefront .obj file.
The approach is to not invert the x axis, as negatives mess with pathfinding libraries like recastnavigation. Instead we swap x and z on everything,
which works perfectly for pathfinding. With recast we just have to swap x and z on the vectors that we give it and get back from it.
This should be put in your "Editor"-folder. Use by selecting the objects you want to export, and select
"Custom->Export Scene" which will export to for_navmesh.obj in the root of your unity project.
View grid_tracking
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace PvpGame
public sealed class Objectpool2<T>
where T : new()
View gist:e1ed822440dd45f1e4c9
'id' => 'ship',
'item1' => 'wood',
'item1_quantity' => 2,
'item2' => 'iron_ore',
'item2_quantity' => 2
'id' => 'pier',
'item1' => 'wood',
gamemachine / gist:1861191
Created Feb 18, 2012
jruby yaml parsing backtrace
View gist:1861191
java.lang.System.arraycopy(Native Method)
View gist:3660841
"key": "ent1",
"entities": ["ent2", "ent3"],
"Components": [
"key": "disp1",
"name": "Rage Punch",
"icon_asset": "rage.png",
"type": "display"
View AnimationController.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace GameMachine {
namespace Animation {
public class AnimationController2 : MonoBehaviour {
public enum Layer {
View GridValue.cs
This software is licensed under the Apache 2 license, quoted below.
Copyright 2014 Game Machine.
Copyright 2014 Chris Ochs <chris>
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
View gist:7113668
using System.Net;
using System.Net.Sockets;
using System;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
public class Client
View gist:7113886
T 2013/10/22 23:43:32.686548 -> [AP]
GET /doc/index.html HTTP/1.1.
Connection: keep-alive.
T 2013/10/22 23:43:32.686611 -> [AP]
HTTP/1.1 200 OK.
Server: nginx/1.4.1 (Ubuntu).
gamemachine / ItemCatalog.cs
Created Sep 12, 2015
Scriptablable object as protobuf message container
View ItemCatalog.cs
using UnityEngine;
using io.gamemachine.messages;
namespace GameMachine {
namespace ItemManagement {
[CreateAssetMenu(menuName =@"ItemCatalog")]
public class ItemCatalog : ScriptableProtobuf<PlayerItems> {