Skip to content

Instantly share code, notes, and snippets.

Avatar

Markus Wellmann mrwellmann

View GitHub Profile
@mrwellmann
mrwellmann / DependencyResolver.cs
Created Jul 27, 2021
DependencyResolver for Unity - This is essentially doing dependency injection.
View DependencyResolver.cs
//source https://github.com/microsoft/MixedRealityToolkit-Unity/issues/1654#issuecomment-359114223
using System;
using System.Collections.Generic;
using System.Reflection;
/// <summary>
/// The dependency resolver allows classes to register themselves as the instance to be used for a given interface.
/// Other classes can then query the dependency resolver to get the instance to use.
/// This is essentially doing dependency injection.
@mrwellmann
mrwellmann / UnityHololens.gitignore
Created Mar 9, 2017
Template for Hololens Unity .gitignore file
View UnityHololens.gitignore
#Sources:
#https://github.com/github/gitignore/blob/master/Unity.gitignore
#https://github.com/Microsoft/HoloToolkit-Unity/blob/master/.gitignore
#https://github.com/Microsoft/GalaxyExplorer/blob/master/.gitignore
#https://gist.github.com/Ikalou/197c414d62f45a1193fd
# =============== #
# Unity generated #
# =============== #
/[Ll]ibrary/
@mrwellmann
mrwellmann / RandomDistinctIntegers.cs
Created Oct 26, 2016
Random distinct integers for Unity
View RandomDistinctIntegers.cs
using UnityEngine;
public static class RandomDistinctIntegers
{
/// <summary>
/// Generates distinct integers.
/// The Integers inside the array are not randomized. If n = range;
/// This Algorithm works good for a lager amount of numbers and uses less memory than Fischer.
/// Source: https://visualstudiomagazine.com/articles/2013/07/01/generating-distinct-random-array-indices.aspx
/// </summary>
/// <param name="size"> Number of distinct values to generate.</param>
View Unity3DEmptyFolderTool.cs
/// <summary>
/// This tool helps to identify and remove empty folders from your Unity 3D project.
///
/// /// Why do I need this:
/// Empty folders are not committed by git but the connected meta files are.
/// So there will be a creation - deletion cycle between between person with and without such a folder.
///
/// /// Usage:
/// The tool adds a new menu Tools->Empty Folder Tool.
/// 1. If you "Toggle Auto Delete", every time you remove or move something in your project