Skip to content

Instantly share code, notes, and snippets.

@paullj
paullj / problem.ts
Created March 21, 2020 00:16
Mapping problem
fromThis = [
{
name: 'A',
child: {
x: "X",
y: "Y"
}
},
{
name: 'B',
import socket from './../socket'; // Doesnt work.
// This works though
// import io from 'socket.io-client'
// const socket = io();
//...
function startPath(point) {
//...
@paullj
paullj / JSONEditor.cs
Last active October 16, 2020 08:57
A JSON Editor in the inspector. Preview and more information in comments 🙂
using System.IO;
using System.Linq;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEngine;
using UnityEditor;
using System;
@paullj
paullj / Coordinate.cs
Created January 28, 2017 18:34
A Coordinate data type for Unity. This is essentially an int Vector2.
using UnityEngine;
[System.Serializable]
public struct Coordinate
{
public static Coordinate zero = new Coordinate (0, 0);
public static Coordinate one = new Coordinate (1, 1);
public static Coordinate north = new Coordinate (0, 1);
public static Coordinate south = new Coordinate (0, -1);