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 Cysharp.Threading.Tasks; | |
using System.Diagnostics.CodeAnalysis; | |
using System.IO; | |
using UnityEditor; | |
using UnityEditor.Recorder; | |
using UnityEditor.Recorder.Input; | |
using UnityEngine; | |
[DefaultExecutionOrder(-50)] | |
public class IconRecorder : MonoBehaviour |
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 static class SerializedPropertyUtility | |
{ | |
private static readonly MethodInfo getFieldInfoFromProperty; | |
static SerializedPropertyUtility() | |
{ | |
var scriptAttributeUtility = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.ScriptAttributeUtility"); | |
Assert.IsNotNull(scriptAttributeUtility, "ScriptAttributeUtility != null"); | |
getFieldInfoFromProperty = scriptAttributeUtility.GetMethod(nameof(GetFieldInfoFromProperty), BindingFlags.NonPublic | BindingFlags.Static); |
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 UnityEngine; | |
public class FastNoiseRNG : FastNoiseLite | |
{ | |
#region Fields | |
private ulong _position; | |
#endregion |
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 sealed class ReferenceDrawerAttribute : PropertyAttribute { } |
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 Pathfinding; | |
using Pathfinding.Serialization; | |
using Pathfinding.Util; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
using UnityEngine.Tilemaps; | |
[Preserve] |
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; | |
[Serializable] | |
public struct SmoothDampState | |
{ | |
#region Fields | |
public float Damping; |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Unity Field</Title> | |
<Shortcut>uf</Shortcut> | |
<Description>Code snippet for property and serialized backing field</Description> | |
<Author>TheBeardPhantom</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
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 static bool IsNull<T>(this T obj) where T : class | |
{ | |
if(obj is UnityEngine.Object unityObj) | |
{ | |
/* Invokes Unity's custom == check for nulls. | |
* This case technically only works because obj is | |
* a "fake null" on the C# side by this point. | |
* If its a true null it'd hit the else case instead, | |
* which fortunately still returns what we want. | |
*/ |
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 PointerService : IPointerService | |
{ | |
#region Fields | |
private readonly List<RaycastResult> _raycastResults = new List<RaycastResult>(); | |
private int _lastRaycastFrameCount = -1; | |
#endregion |
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 static class SpriteShapeEditorHelper | |
{ | |
#region Methods | |
[MenuItem("CONTEXT/SpriteShapeController/Center Transform")] | |
private static void CenterTransform(MenuCommand cmd) | |
{ | |
var controller = cmd.context as SpriteShapeController; | |
Undo.RecordObjects( |