Skip to content

Instantly share code, notes, and snippets.

View omgwtfgames's full-sized avatar

Andrew Perry omgwtfgames

View GitHub Profile
@omgwtfgames
omgwtfgames / TagsLayersEnumBuilder.cs
Created April 25, 2016 22:27 — forked from Namek/TagsLayersEnumBuilder.cs
Tags and Layers Enums Builder for Unity3D
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
using System;
using System.IO;
using System.Text;
public class TagsLayersEnumBuilder : EditorWindow {
[MenuItem("Edit/Rebuild Tags And Layers Enums")]
// A loop drop table for Unity, somewhat inspired by http://www.lostgarden.com/2014/12/loot-drop-tables.html
// TODO: Use properties { get; set } to automatically call UpdateWeightRanges() when
// any Weight is changed, or any item is added or removed from the list
// We could then also add an autoupdating (readonly) Sum field, replacing calls to GetSumOfWeights()
// TODO: Rather than making Prefab a GameObject, call it Obj and make this a LootTable<T> generic so we
// can use any type as the associated object.
//
@omgwtfgames
omgwtfgames / HelicalLayout.cs
Created August 9, 2017 11:26
Helical object layout in Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HelicalLayout : MonoBehaviour
{
int _numberOfNodes;
public float Radius = 1f;
public float Pitch = 1f;
public float Turn = 30f;
@omgwtfgames
omgwtfgames / vector.py
Last active August 27, 2017 07:49 — forked from jordvisser/vector.py
A vector class in pure python.
"""
The MIT License (MIT)
Copyright (c) 2015 Mat Leonard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is