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) 2017 Eric Phillips | |
* | |
* 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, |
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
/* SceneViewShaderKeyword.cs | |
* © Eddie Cameron 2020 | |
* ---------------------------- | |
*/ | |
using System; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; |
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
/* GroupSelected.cs | |
* © Eddie Cameron 2020 | |
* ---------------------------- | |
*/ | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
/// <summary> | |
/// Groups all selected scene transforms under a single parent. |
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; | |
/// In Unity pre 2020, each different type you want to make a list from needs its own subclass, like UnityEvents. | |
/// eg : | |
/// [Serializable] public class IntReorderableList : ReorderableList<int> {} | |
[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
/// <summary> | |
/// Convert a KeyCode into the string that Unity uses in GetKeyString | |
/// (ToString returns a different value -_-) | |
/// </summary> | |
/// <param name="kc"></param> | |
/// <returns></returns> | |
public static string KeycodeToKeyString( KeyCode kc ) { | |
switch ( kc ) { | |
// numerals | |
case KeyCode.Alpha0: |
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 UnityEngine.Rendering.PostProcessing; | |
[Serializable] | |
[PostProcess( typeof( EdgeDetectRenderer ), PostProcessEvent.BeforeStack, "Custom/EdgeDetectNormals" )] | |
public sealed class EdgeDetect : PostProcessEffectSettings { | |
public enum EdgeDetectMode { |
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
/* SmoothSwitcher.cs | |
* Copyright Eddie Cameron 2015 | |
* ---------------------------- | |
* When you want some value to switch slowly between on and off without all that fuss about whether it's already changing or whatnot | |
* (eg: light dimmer switch, audio fade in/out, zoom) | |
* ----------------------------- | |
* Can be added to an object at runtime, with SmoothSwitcher.SetupSmoothSwitcher(...) | |
* Otherwise, make sure to set the SmoothSwitcher's onAmountSet event in the inspector, which will be called whenever the 'on amount' changes | |
* (when setting an event listener method, make sure to choose a 'dynamic' method in the selection menu, otherwise it'll just call whatever number is in the box) | |
* ----------------------------- |