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; | |
#if UNITY_EDITOR | |
[System.AttributeUsage(System.AttributeTargets.Field)] | |
public class RenameAttribute : PropertyAttribute | |
{ | |
public string[] renamePairs; | |
public RenameAttribute(params string[] renamePairs) | |
{ |
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.Linq; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEditor.Compilation; | |
using UnityEngine; | |
public static class FlyoutProjectWindow | |
{ |
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 "Unlit/MatCap Techniques" | |
{ | |
Properties | |
{ | |
[NoScaleOffset] _MatCap ("MatCap", 2D) = "white" {} | |
[KeywordEnum(ViewSpaceNormal, ViewDirectionCross, ViewDirectionAligned)] _MatCapType ("Matcap UV Type", Float) = 2 | |
} | |
SubShader | |
{ | |
Tags { "RenderType"="Opaque" } |
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
// Allows you to change the up vector in the scene view to the Z axis. | |
// Y-up mode uses Unity's default implementation. | |
// | |
// Original code from Akulist on the Unity forums, modified by Freya Holmér: | |
// • Fixed orbit+RMB zoom not working | |
// • Toggling will now align the camera immediately to the new up vector | |
// • When the camera is upside down in Z axis mode, left/right orbit will no longer be mirrored (pls fix this too Unity~) | |
// • Moved toggle buttons to under the gizmo | |
// • Fixed broken rotation state when focusing a different window in Unity and coming back to the scene view | |
// |
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.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
public class MaterialGradientDrawer : MaterialPropertyDrawer { | |
private int resolution; |
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
#ifdef PSXDTH | |
#else | |
#define PSXDTH | |
//PS1 Hardware Dithering & Color Precision Truncation Function | |
//by ompu co | Sam Blye (c) 2020 | |
//PS1 dither table from PSYDEV SDK documentation |
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 UnityEditor; | |
using System.Collections.Generic; | |
using System.IO; | |
//https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html | |
public class ShaderOccurenceWindow : EditorWindow { | |
[MenuItem ("Tools/Shader Occurence")] | |
public static void Open () { |
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
// This file is in the public domain. Where | |
// a public domain declaration is not recognized, you are granted | |
// a license to freely use, modify, and redistribute this file in | |
// any way you choose. | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// Unity remake of a fake volumetric light glow effect |
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 class MyBehavior : MonoBehaviour { | |
// This will store the string value | |
[StringInList("Cat", "Dog")] public string Animal; | |
// This will store the index of the array value | |
[StringInList("John", "Jack", "Jim")] public int PersonID; | |
// Showing a list of loaded scenes | |
[StringInList(typeof(PropertyDrawersHelper), "AllSceneNames")] public string SceneName; | |
} |
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; | |
// based on http://unitytipsandtricks.blogspot.com/2013/05/camera-shake.html | |
public class PerlinShake : MonoBehaviour | |
{ | |
public float duration = 2f; | |
public float speed = 20f; | |
public float magnitude = 2f; | |
public AnimationCurve damper = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(0.9f, .33f, -2f, -2f), new Keyframe(1f, 0f, -5.65f, -5.65f)); |
NewerOlder