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; | |
/// <summary> | |
/// Bezier Curve Line Renderer for Unity, credit goes to World of Zero: https://www.youtube.com/watch?v=tgCFzoG_BJM | |
/// </summary> | |
[ExecuteInEditMode] | |
public class BezierCurve3PointLineRenderer : 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
using UnityEngine; | |
using UnityEditor; | |
public class ScriptAutoRefreshControl : MonoBehaviour | |
{ | |
/// <summary> | |
/// Turns Auto Refresh option on and off (it is about script recompilation, domain reload). | |
/// Same as going to Edit -> Preferences -> General and changing Auto Refresh option. | |
/// </summary> |
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; | |
/// <summary> | |
/// Vector3.Distance(a,b) is the same as (a-b).magnitude | |
/// Since computing squared magnitudes is faster than Vector3.magnitude, (a - b).sqrMagnitude is more performant than Vector3.Distance | |
/// </summary> | |
public class PerformanceEnhancer : MonoBehaviour | |
{ | |
public static float Distance(Vector3 a, Vector3 b) |
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; | |
// REMEMBER that for custom attributes with property drawers, the attribute script should be in normal folder, while the drawer script - in the editor folder | |
public class AutofillAttribute : PropertyAttribute { } | |
[CustomPropertyDrawer(typeof(AutofillAttribute))] | |
public class AutofillAttributeDrawer : PropertyDrawer | |
{ |
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; | |
using UnityEditor; | |
[CustomEditor(typeof(SpritesheetPivotEditor))] | |
public class SpritesheetPivotEditor : EditorWindow | |
{ | |
[MenuItem("Tools/Sprites/Pivot Editor")] | |
static void OpenPivotEditor() | |
{ |
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 UnityEngine; | |
public class ScriptableObjectMassCreator : EditorWindow | |
{ | |
public string str; | |
public bool FromText; | |
public bool SplitComma; | |
[MenuItem("Window/Scriptable Object Mass Creator")] |
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; | |
/// Taken from: https://gist.github.com/SiarheiPilat/05463e64d4662860c6a799bb23d9aec8 | |
/// Forked from: https://gist.github.com/unity3dcollege/c1efea3f87d3775bee3e010e9c6d7648 | |
/// Author: Siarhei Pilat (Suasor AB) | |
/// License: MIT | |
public class ReplaceWithPrefab : EditorWindow | |
{ |
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 class ReverseAnimationLegacy : MonoBehaviour | |
{ | |
Animation Animation; | |
void Start() | |
{ | |
Animation = GetComponent<Animation>(); | |
Animation["walk"].speed = -0.25f; |
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
// Adapted from https://docs.unity3d.com/ScriptReference/PrefabUtility.html | |
using UnityEngine; | |
using UnityEditor; | |
public class MultiprefabCreator | |
{ | |
// Creates a new menu item 'Examples > Create Prefab' in the main menu. | |
[MenuItem("Window/Create Prefab")] | |
static void CreatePrefab() |
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
#if UNITY_EDITOR | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
// TODO: if the level is unchecked in build settings, the loop starts over | |
public class ShortcutLevelLoader | |
{ | |
[MenuItem("Level loader/Load previous level &LEFT")] |