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.Collections; | |
using UnityEditor; | |
namespace BSGTools { | |
namespace EditorUtilities { | |
public class ZeroAll : Editor { | |
[MenuItem("GameObject/Reset/Zero All %&a")] | |
static void ResetAll() { | |
GameObject[] selection = Selection.gameObjects; |
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 UnityEngine; | |
namespace BSGTools.Extensions { | |
public static class TransformExtensions { | |
public static void SetTreePosition(this Transform child, Transform target) { | |
child.root.position = target.position; | |
child.root.position += target.position - child.position; | |
} |
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
namespace BSGTools.Math { | |
public static class Normalizer { | |
public static float NormalizeAngle(float value) { | |
return Normalize(value, 0f, 360f); | |
} | |
public static float Normalize(float value, float start, float end) { | |
float width = end - start; | |
float offsetValue = value - start; // value relative to 0 |
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 System.IO; | |
using UnityEngine; | |
using SE = System.Environment; | |
using SF = System.Environment.SpecialFolder; | |
public static class GameState { | |
static string _STATE_FOLDER = CombinePaths(SE.GetFolderPath(SF.MyDocuments), "My Games"); | |
public static string STATE_FOLDER { get { return _STATE_FOLDER; } set { _STATE_FOLDER = value; } } |
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
# Ignore everything | |
/* | |
/*/ | |
# Inverse ignore some stuff | |
!/Assets/ | |
!/ProjectSettings/ | |
!.gitignore | |
# OS Stuff |
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.Collections; | |
using UnitySampleAssets.ImageEffects; | |
[ExecuteInEditMode] | |
[AddComponentMenu("Image Effects/Color Adjustments/Gamma")] | |
public class Gamma : PostEffectsBase { | |
public enum ColorCorrectionMode { | |
Simple = 0, | |
Advanced = 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 created with Shader Forge v1.04 | |
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/ | |
// Note: Manually altering this data may prevent you from opening it in Shader Forge | |
/*SF_DATA;ver:1.04;sub:START;pass:START;ps:flbk:Diffuse,lico:1,lgpr:1,nrmq:1,limd:1,uamb:True,mssp:True,lmpd:False,lprd:False,rprd:False,enco:False,frtr:True,vitr:True,dbil:False,rmgx:True,rpth:0,hqsc:True,hqlp:False,tesm:0,blpr:0,bsrc:0,bdst:1,culm:0,dpts:2,wrdp:True,dith:2,ufog:True,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:2942,x:32753,y:32707,varname:node_2942,prsc:2|diff-1116-RGB,olwid-5129-OUT,olcol-2465-RGB;n:type:ShaderForge.SFN_Color,id:2465,x:32474,y:33133,ptovrint:False,ptlb:lineColor,ptin:_lineColor,varname:_outlineColor,prsc:2,glob:False,c1:1,c2:1,c3:0.5607843,c4:1;n:type:ShaderForge.SFN_Tex2d,id:1116,x:32519,y:326 |
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
javascript:(function(){ try { var version="1.1.3";var xmlHttp=null;xmlHttp=new XMLHttpRequest();xmlHttp.open("GET","https://api.github.com/gists/14a1c2ab6d69a832f29b",false);xmlHttp.send(null);var raw=xmlHttp.responseText;var json=JSON.parse(raw);if(json.files["version.txt"]["content"]!=version){prompt("There is a new version of SWSM. The latest script has been retrieved and is in the below text box. Edit your SWSM bookmarklet, replace the current URL value with the value below, and then rerun the bookmarklet.",json.files["SWSM.js"]["content"]);return;} } catch(err){} var unsubAll=false;var wl=window.location.toString();if(wl.toString().indexOf("browsefilter=mysubscriptions")==-1||wl.indexOf("steamcommunity.com")==-1){var uPrompt=prompt("Not on the correct page! Enter your steam username (not account name!). When the workshop page finishes loading, run this bookmarklet again.");if(uPrompt!=null){window.location="http://steamcommunity.com/id/"+uPrompt+"/myworkshopfiles?browsefilter=mysubscriptions&numperpage=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; | |
using System.Collections; | |
using UnityEngine.UI; | |
namespace Rubycone.BoltAction { | |
[ExecuteInEditMode] | |
[RequireComponent(typeof(LayoutElement))] | |
public class InferSize : MonoBehaviour { | |
public Graphic targetGraphic; |
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.Linq; | |
using UnityEngine; | |
namespace Rubycone.Utils { | |
public delegate void LoadComplete(GameObject loaded); | |
public class SceneLoader : MonoBehaviour { | |
public event LoadComplete LoadComplete; | |
public AsyncOperation operation { get; private set; } |
OlderNewer