Skip to content

Instantly share code, notes, and snippets.

View gamemachine's full-sized avatar

Chris Ochs gamemachine

View GitHub Profile
@gamemachine
gamemachine / gist:51c4af5cd0a3e1f8fd56
Created July 26, 2014 08:38
Unity Scene exporter for navigation meshes
/*
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.
*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace PvpGame
{
public sealed class Objectpool2<T>
where T : new()
{
{
'id' => 'ship',
'item1' => 'wood',
'item1_quantity' => 2,
'item2' => 'iron_ore',
'item2_quantity' => 2
},
{
'id' => 'pier',
'item1' => 'wood',
@gamemachine
gamemachine / gist:1861191
Created February 18, 2012 22:26
jruby yaml parsing backtrace
java.lang.System.arraycopy(Native Method)
org.yecht.IoStrRead$Default.read(IoStrRead.java:38)
org.yecht.Parser.read(Parser.java:247)
org.yecht.TokenScanner.real_yylex(TokenScanner.java:222)
org.yecht.TokenScanner.advance(TokenScanner.java:51)
org.yecht.DefaultYAMLParser.yyparse(DefaultYAMLParser.java:312)
org.yecht.Parser.yechtparse(Parser.java:290)
org.yecht.Parser.parse(Parser.java:284)
"Entities":[
{
"key": "ent1",
"entities": ["ent2", "ent3"],
"Components": [
{
"key": "disp1",
"name": "Rage Punch",
"icon_asset": "rage.png",
"type": "display"
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace GameMachine {
namespace Animation {
public class AnimationController2 : MonoBehaviour {
public enum Layer {
Base,
/*
This software is licensed under the Apache 2 license, quoted below.
Copyright 2014 Game Machine.
Copyright 2014 Chris Ochs <chris @ochsnet.com>
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
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
{
T 2013/10/22 23:43:32.686548 127.0.0.1:38695 -> 127.0.0.1:80 [AP]
GET /doc/index.html HTTP/1.1.
Connection: keep-alive.
Host: 127.0.0.1.
.
T 2013/10/22 23:43:32.686611 127.0.0.1:80 -> 127.0.0.1:38695 [AP]
HTTP/1.1 200 OK.
Server: nginx/1.4.1 (Ubuntu).
ActorSystemRefs.ActorSystem.ActorOf(ClusterSingletonManager.Props(
singletonProps: Props.Create<ClusterSingletonActor>(),
terminationMessage: PoisonPill.Instance,
settings: ClusterSingletonManagerSettings.Create(ActorSystemRefs.ActorSystem)),
name: "manager");
SystemActors.SingletonProxy = ActorSystemRefs.ActorSystem.ActorOf(ClusterSingletonProxy.Props(
singletonManagerPath: "/user/manager",
settings: ClusterSingletonProxySettings.Create(ActorSystemRefs.ActorSystem)),
name: "managerProxy");