Skip to content

Instantly share code, notes, and snippets.

View kurtdekker's full-sized avatar

Kurt Dekker kurtdekker

View GitHub Profile
@kurtdekker
kurtdekker / ConwaysGOL.cs
Created June 21, 2022 13:41
Conways Game of Life (GOL) cellular automata
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker
//
// ultra dead-simple Conways Game Of Life (GOL) implementation in Unity
//
// To use:
// Make the default blank scene with a Camera / Light
@kurtdekker
kurtdekker / AimhelperTarget.cs
Created June 11, 2022 21:59
Unity screen-space auto-aim helper (aimbot)
using UnityEngine;
public class AimhelperTarget : MonoBehaviour
{
// @kurtdekker - nothing to see here; just put this
// on target GameObjects you want to assist-aim to.
//
// All the magic happen over in BasicAimHelper.cs
}
@kurtdekker
kurtdekker / Highlander.cs
Created June 4, 2022 18:04
ultra simple almost not worth it singleton... see comments
// @kurtdekker
//
// An ultra-basic bare-bones singleton: "There can only be one."
// - Simply access it via .Instance static property.
// - You cannot new another one up. You can't even new this one up.
//
// WARNING: be VERY careful about lifecycle of something like this
// in Unity! Unity runs Object constructors NOT on the main thread!
//
// For somewhat more useful constructs for a Unity context, check out these:
@kurtdekker
kurtdekker / AddRingOfSphereColliders.cs
Last active March 28, 2024 04:48
Creates a torus of SphereColliders to allow a torus with a Rigidbody in Unity3D
using UnityEngine;
using UnityEditor;
// @kurtdekker - easy cheesy add sphere colliders in a circle (for a torus)
// see notes below for how to make it go around a different axis
public class AddRingOfSphereColliders : EditorWindow
{
int count = 24;
float largeRadius = 2.0f;
using UnityEngine;
using System;
//Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com)
//Modified by: -
[ AttributeUsage( AttributeTargets.Field ) ]
public class ConditionalHideAttribute : PropertyAttribute
{
public readonly string ConditionalSourceField;
using UnityEngine;
// @kurtdekker
//
// ultra-simple core of "shuffle and pick"
//
// drop this on a blank GameObject and run
public class ShuffleAndPick : MonoBehaviour
{
@kurtdekker
kurtdekker / SearchXPTable.cs
Created April 21, 2022 14:19
Simple demonstration of looking up XP into a Player Level table
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker - ultra-simple XP to Level lookup table
// drop it on a blank GameObject to test it, look in the console
public class SearchXPTable : MonoBehaviour
{
// CAUTION: This is subject to all of Unity3D's serialization rules!!!
@kurtdekker
kurtdekker / SilverLooper.cs
Created March 13, 2022 20:19
Angry Birds, Silver: Looping Legend code for Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// kurtdekker
// A looping downward attack like Angry Birds, Silver: Looping Legend
//
// To use:
// - put this on your Rigidbody2D object
// - send it flying
@kurtdekker
kurtdekker / StarCastle.cs
Created March 2, 2022 15:49
Simple star castle style rotating fortress generation
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker
//
// to use, just drop this onto a blank GameObject located where you want the rings
public class StarCastle : MonoBehaviour
{
@kurtdekker
kurtdekker / LevelDefinition.cs
Created February 24, 2022 17:11
Example ScriptableObject-based LevelDefinition object
using UnityEngine;
// @kurtdekker
//
// An example "level definition" object.
//
// The purpose is to centralize all the things you need to
// present, select and launch a given level.
//
// To use: