This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Text; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class LSystemGenerator : MonoBehaviour | |
{ | |
[Serializable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour | |
{ | |
protected static T instance; | |
/** | |
Returns the instance of this singleton. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .gitignore for IntelliJ & Gradle made by @miichidk | |
# IntelliJ | |
*.iml | |
.idea/ | |
*.ipr | |
*.iws | |
/out/ | |
.idea_modules/ | |
atlassian-ide-plugin.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
namespace Default // or <Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>] | |
{ | |
public class Example | |
{ | |
// first consts | |
public const int TheAnswer = 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These 3 pieces of codes, are all returning wether a list/dictionary has elements or not. | |
Normal: | |
int count = 0; | |
foreach (var ep in IPEndPoints) | |
{ | |
if (ep.Value == null) | |
{ | |
count++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TagManager | |
{ | |
private const string TAG_MANAGER_PATH = "ProjectSettings/TagManager.asset"; | |
public static bool ContainsTag(string tag) | |
{ | |
SerializedProperty prop; | |
if (GetAssetDatabase(out prop)) | |
{ | |
for (int i = 0; i < prop.arraySize; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.CodeDom; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
using UnityEngine; | |
using UnityEditor; | |
using Random = UnityEngine.Random; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
for /F "tokens=*" %%i in (repos.txt) do call :DOSTUFF %%i | |
pause > nul | |
:DOSTUFF | |
echo "Cloning %~1" | |
git clone https://michidk@bitbucket.org/brokenvector/%~1.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An outline shader made for Unity with the help of @OverlandGame by @miichidk | |
// It adjusts the size of the outline to automatically accomodate screen width and camera distance. | |
// See how it looks here: https://twitter.com/OverlandGame/status/791035637583388672 | |
// How to use: Create a material which uses this shader, and apply this material to any meshrenderer as second material. | |
Shader "OutlineShader" | |
{ | |
Properties | |
{ | |
_Width ("Width", Float ) = 1 | |
_Color ("Color", Color) = (1,1,1,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader /*ase_name*/ "CustomUnlit" /*end*/ | |
{ | |
Properties | |
{ | |
/*ase_props*/ | |
} | |
SubShader | |
{ | |
Tags{ "RenderType" = "Opaque" "LightMode" = "ForwardBase" /*ase_tags*/ } |
OlderNewer