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.Rendering.Universal; | |
using System; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
using SCPE; | |
namespace Ardenfall.Effects | |
{ | |
[Serializable, VolumeComponentMenu("Ardenfall/Distant Pixelize")] |
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 "Ardenfall/Effects/DistantPixelize" | |
{ | |
HLSLINCLUDE | |
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" | |
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" | |
float _MaxPixelSize; | |
float _MinPixelSize; | |
float _MaxDistance; |
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 UnityEditor; | |
using UnityEditor.Presets; | |
using System.IO; | |
namespace Ardenfall | |
{ | |
/// <summary> | |
/// Post Processer that automatically finds the nearest preset |
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; | |
public class FullEditorStyles | |
{ | |
public static GUIStyle CNBox => new GUIStyle("CN Box"); | |
public static GUIStyle CNEntryInfo => new GUIStyle("CN EntryInfo"); | |
public static GUIStyle CNEntryWarn => new GUIStyle("CN EntryWarn"); | |
public static GUIStyle CNEntryError => new GUIStyle("CN EntryError"); | |
public static GUIStyle CNEntryBackEven => new GUIStyle("CN EntryBackEven"); |
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
//Just set EditorGUI.s_SelectAllOnMouseUp (an internal variable) to false every frame / every time you draw. | |
//This variable is usually set to true in certain circumstances, so we're overwriting the value. | |
//I honestly don't know why this feature exists, it's quite annoying and never useful. | |
//Of course, be sure to cache the field! | |
selectAllField = typeof(EditorGUI).GetField("s_SelectAllOnMouseUp", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Default); | |
selectAllField.SetValue(null, false); |
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; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
/* | |
* Saves custom GUID for a gameobject. Will automatically make sure |
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.Reflection; | |
using System; | |
//Special thanks to Shamanim for solution | |
//https://forum.unity.com/threads/sorta-solved-check-if-gameobject-is-dirty.504894/#post-3967810 | |
public class IsDirtyUtility | |
{ | |
//Cached 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
/* | |
* References: | |
* https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/ProjectWindow/SearchFilter.cs | |
* https://github.com/jamesjlinden/unity-decompiled/blob/master/UnityEditor/UnityEditor/ProjectBrowser.cs | |
*/ | |
public class ProjectWindowHelper | |
{ | |
public struct ProjectSearch | |
{ |
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
//Note that Awake, Update, and Start functions could be implemented the same way Destroy is... however, | |
//This of course would probably result in a lot of unneeded mono events. So... yeah. | |
public class BaseBehavior : MonoBehaviour | |
{ | |
//Transform cacheing | |
private Transform _transform; | |
public Transform Transform | |
{ |