Skip to content

Instantly share code, notes, and snippets.

View ConsoleUtilitiesEditor.cs
using UnityEditor;
using System.Reflection;
using System;
public static class ConsoleUtilitiesEditor
{
[MenuItem("Tools/Clear Console %#c")] // Cmd/Ctrl + Shift + C
private static void ClearConsoleMenuItem()
{
ClearConsole();
View RandomDungeonConnectCenters.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Random = CraftingLegends.Core.Random;
namespace CraftingLegends.Framework
{
public class RandomDungeonConnectCenters : MonoBehaviour
{
[System.Serializable]
View ShowFileExtensions.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using System.IO;
using System.Reflection;
[InitializeOnLoad]
public static class ShowFileExtensions
{
View AssetFilesCounter.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
public static class AssetFilesCounter
{
[MenuItem("Utilities/Count Asset Files")]
public static void CountAssetFiles()
View TestScriptWithReorderableList.cs
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditorInternal;
#endif
View Sprites-PixelArt.shader
/*
Basic Sprite Shader for aligning pixel art to the same grid, based on the Unity Sprite Shader.
Create one Material where you assign the same Pixels Per Unit value you use on your imported Sprites,
then reuse this Material on all appropriate Sprite Renderers.
(You can use Shader.SetGlobalFloat to set that Pixels Per Unit value for all your shaders:
https://docs.unity3d.com/ScriptReference/Shader.SetGlobalFloat.html)
This is not for scaled or rotated artwork. If you need those features, look at low res render textures.
Use this however you want.
View PivotUtilities.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public static class PivotUtilities
{
[MenuItem("GameObject/Pivot/Create Pivot", false, 0)]
static void CreatePivotObject()
{
View ColorToCSharp.cs
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
public class ColorToCSharp : EditorWindow
{
[SerializeField]
private bool _usedColorPickerOnce = false;
View SpriteImportProcessor.cs
using UnityEngine;
using UnityEditor;
using System.IO;
// example PostProcessor for adjusting automatic Sprite Import settings
// save this in any "Editor" Folder
public class SpriteImportProcessor : AssetPostprocessor
{
void OnPostprocessSprites(Texture2D texture, Sprite[] sprites)
{
View 81-C# Script-NewBehaviourScript.cs.txt
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using Random = UnityEngine.Random;
public class #SCRIPTNAME# : MonoBehaviour
{
void Start()
{