Skip to content

Instantly share code, notes, and snippets.

View Thundernerd's full-sized avatar
🎉

Christiaan Bloemendaal Thundernerd

🎉
View GitHub Profile
@Thundernerd
Thundernerd / .editorconfig
Last active April 22, 2024 07:14
My personal (and very strict) .editorconfig
root = true
[*.{cs,vb}]
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
@Thundernerd
Thundernerd / WebColors.cs
Last active April 19, 2023 19:00
List of colors that are supported by all modern browsers, ported over to C# to use with Unity3D
using UnityEngine;
public class WebColors
{
public static readonly Color AliceBlue = new Color32(240, 248, 255, 255);
public static readonly Color AntiqueWhite = new Color32(250, 235, 215, 255);
public static readonly Color Aqua = new Color32(0, 255, 255, 255);
public static readonly Color Aquamarine = new Color32(127, 255, 212, 255);
public static readonly Color Azure = new Color32(240, 255, 255, 255);
public static readonly Color Beige = new Color32(245, 245, 220, 255);
@Thundernerd
Thundernerd / PocoDrawer.cs
Last active December 8, 2021 08:29
Unity3D drawer class that can be used to draw an object using its regular/custom drawer from within an EditorWindow
public class PocoDrawer : IDisposable
{
private class ReferenceHolder : ScriptableObject
{
[SerializeReference] public object reference;
}
private readonly ReferenceHolder referenceHolder;
private readonly SerializedObject serializedObject;
private readonly SerializedProperty serializedProperty;
@Thundernerd
Thundernerd / .gitattributes
Created September 28, 2020 07:17 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@Thundernerd
Thundernerd / AutohookAttribute.cs
Created June 12, 2020 11:23 — forked from LotteMakesStuff/AutohookAttribute.cs
[Autohook] property drawer for unity - Add this [Autohook] attribute to a property to and the inspector will automagically hook up a valid reference for you if it can find a component attached to the same game object that matches the field you put it on. You can watch a demo of this in action here https://youtu.be/faVt09NGzws <3
// NOTE DONT put in an editor folder!
using UnityEngine;
public class AutohookAttribute : PropertyAttribute
{
}
@Thundernerd
Thundernerd / Docker.cs
Last active January 24, 2024 09:32
Helper to dock EditorWindows
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class Docker
{
#region Reflection Types