Skip to content

Instantly share code, notes, and snippets.

@MicKami
MicKami / GraphSearch.cs
Created December 4, 2023 12:05
Code sample
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using MicKami.BinaryHeap;
using static UnityEngine.Mathf;
public class GraphSearch
{
private readonly Graph graph;
@MicKami
MicKami / Dodecahedron.cs
Last active March 15, 2023 18:43
Code for creating Regular Dodecahedron (12 regular pentagons as walls).
Mesh CreateDodecahedron(float radius)
{
const float phi = 1.618034f;
Vector3[] vertices = new Vector3[]
{
new Vector3(1, 1, 1),
new Vector3(1, 1, -1),
new Vector3(1, -1, 1),
new Vector3(-1, 1, 1),
@MicKami
MicKami / QuadShader.shader
Created January 7, 2023 12:55
Geometry shader for unity that creates camera facing quads at vertices
Shader "Custom/QuadShader"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
}
SubShader
{
Cull Off
@MicKami
MicKami / MaximumAttribute.cs
Created January 22, 2019 20:16
Unity custom property attributes
using UnityEngine;
public class MaximumAttribute : PropertyAttribute
{
public float maximumValue { get; private set; }
public MaximumAttribute(float maximum)
{
this.maximumValue = maximum;
}