Skip to content

Instantly share code, notes, and snippets.

View NeatWolf's full-sized avatar

NeatWolf NeatWolf

View GitHub Profile
using UnityEngine;
using System.Reflection;
/// <summary>
/// Automatically provides a version number to a project and displays
/// it for 20 seconds at the start of the game.
/// </summary>
/// <remarks>
/// Change the first two number to update the major and minor version number.
@hodzanassredin
hodzanassredin / Traits.cs
Created October 9, 2011 10:43
c# trait mixins via intefaces and extension methods
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Traits;
namespace TraitsMixin
{
//trait Similarity
public interface TraitSimilarity {
@NeatWolf
NeatWolf / gmail-github-filters.md
Created May 1, 2019 13:14 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

from:(notifications@github.com) AND {"Patch Links" "approved this pull request." "requested changes on this pull request." "commented on this pull request." "pushed 1 commit." "pushed 2 commits." "pushed 3 commits."}

label: gh-pull-request

@TocaLucas
TocaLucas / ReplaceMaterials.cs
Last active September 8, 2019 15:45
Unity3D Material Replace Editor
using UnityEngine;
using UnityEditor;
public class ReplaceMaterials : EditorWindow {
static int goCount = 0, replaceCount = 0;
private Material currentMaterial = null;
private Material replaceMaterial = null;
[MenuItem("Stuff/Replace Materials")]
public static void ShowWindow() {
EditorWindow.GetWindow(typeof(ReplaceMaterials));
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FixLightMapTiling : MonoBehaviour {
public GameObject _getLightmapScaleObj;
public GameObject _setLightmapScaleObj;
public Vector4 _lightmapScalOffset;
public int _lightmapIndex;
void OnDrawGizmos()
{
@noisecrime
noisecrime / AssignSceneName
Created June 21, 2014 19:51
Unity - Adding commands to component context/cog menu.
// NoiseCrime Gist
// 2014.06.21
// Unity Version: 3.5.7+
// This script demonstrates how you can use MenuItem to append commands to a script component context menu.
// The new commands will be available by right-clicking on a component header or clicking the little cog icon.
// Docs: http://docs.unity3d.com/ScriptReference/MenuItem.html
// Note: You must use the current class name/type in both the MenuItem and where the context is used in the code.
@noisecrime
noisecrime / Unity Assembly Definition Debugger.cs
Created January 19, 2020 14:02 — forked from karljj1/Unity Assembly Definition Debugger.cs
Find out what assemblies are being built and how long each takes.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEngine;
namespace NoiseCrimeStudios.Editor.Settings
{
@shayded-exe
shayded-exe / ScriptableObjectPropertyDrawer.cs
Last active September 4, 2020 15:12
Put this script in your Editor folder. Then right click on any inspector field that accepts a ScriptableObject to create an asset for it. The asset will also automatically be assigned to the field.
using System;
using System.IO;
using System.Linq;
using System.Linq.Extensions;
using UnityEditor;
using UnityEngine;
namespace PachowStudios.BadTummyBunny.Editor
{
[CustomPropertyDrawer(typeof(ScriptableObject), true)]
@TobiTobascoNollero
TobiTobascoNollero / UIParticleScaler.cs
Last active April 19, 2021 22:14
Unity - Particle Scaling for Particles inside the Unity GUI
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
/* UI Particle Scaling script by Tobi Tobasco Nollero, questions: tobias@lostmountaingames.com, http://tobiasnoller.com/
* Just drag this script on any canvas which has child particle systems underneath.
* Add your resolution change listener to scale your particles when changing resolutions.
* Prewarmed particle system emitting on begin play, will probably not be affected by the script the first time they fire.
* Feel free to use this script in any project.
@kajott
kajott / bluenoise.c
Created June 26, 2019 10:49
Blue Noise texture generation using the void-and-cluster algorithm
#if 0 // self-compiling code
gcc -std=c99 -Wall -Wextra -pedantic -Werror -g -O4 -march=native $0 -lm || exit 1
exec time ./a.out
#endif
// Blue Noise texture generation using the void-and-cluster algorithm
// implemented by Martin Fiedler <keyj@emphy.de>
// using an algorithm description written by Alan Wolfe:
// https://blog.demofox.org/2019/06/25/generating-blue-noise-textures-with-void-and-cluster/