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
safereset = "!f() { \ | |
trap 'echo ERROR: Operation failed; return' ERR; \ | |
echo Making sure there are no changes...; \ | |
last_status=$(git status --porcelain);\ | |
if [[ $last_status != \"\" ]]; then\ | |
echo There are dirty files:;\ | |
echo \"$last_status\";\ | |
echo;\ | |
echo -n \"Enter Y if you would like to DISCARD these changes or W to commit them as WIP: \";\ | |
read dirty_operation;\ |
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.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// A base class for creating editors that decorate Unity's built-in editor types. | |
/// </summary> | |
public abstract class DecoratorEditor : Editor |
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
# create a file C:\Users\[user]\.bashrc | |
# add this content | |
# add your onw aliases or changes these ones as you like | |
# to make a dot (.bashrs) file in windows, create a file ".bashrs." (without extention) and save. windows will save it as ".bashrc" | |
alias ls='ls -alh' | |
alias cdnginx='cd /c/nginx && ls' | |
alias cdmcga='cd /c/Users/[user]/sbox/node/mcga && ls' | |
alias cdfood9='cd /c/Users/[user]/sbox/node/food9 && ls' | |
alias cdmysql='cd /c/nginx/mysql/bin && ls' |
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
// Source: http://forum.unity3d.com/threads/webgl-transparent-background.284699/#post-1880667 | |
// Clears the WebGL context alpha so you can have a transparent Unity canvas above DOM content | |
// Add this .jslib to your project et voila! | |
var LibraryGLClear = { | |
glClear: function(mask) | |
{ | |
if (mask == 0x00004000) | |
{ | |
var v = GLctx.getParameter(GLctx.COLOR_WRITEMASK); | |
if (!v[0] && !v[1] && !v[2] && v[3]) |
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 static class ParticleExtensions | |
{ | |
/// Add Extension to the native ParticleSystem class. | |
/// eg: myParticleSystem.Scale(2); | |
public static void Scale(this ParticleSystem particles, float scale, bool includeChildren = true) { | |
ParticleScaler.Scale(particles, scale, includeChildren); | |
} |
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
// MIT License | |
// | |
// Copyright (c) 2018 Sabresaurus | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.Reflection; | |
public static class EditorExtensionMethods | |
{ | |
// Public reimplmentation of extention methods and helpers that are marked internal in UnityEditor.dll |
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
// Do NOT put me in an /Editor/ folder | |
// Questions/bugs: [email protected] | |
using UnityEngine; | |
public class HighlightAttribute : PropertyAttribute { | |
public Color col; | |
public HighlightAttribute(float r=1, float g=0, float b=0) { | |
this.col = new Color(r,g,b,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
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER | |
using UnityEngine.U2D; | |
#endif | |
using Sprites = UnityEngine.Sprites; | |
#if UNITY_EDITOR |
OlderNewer